Reactive Stream Questions
Douglas Surber
douglas.surber at oracle.com
Tue Jul 31 13:44:27 UTC 2018
Please do not use this thread to discuss the reactive stream proposal. Feel free to discuss the answers to the questions, but not the overall proposal.
Q1: Is Flow.Publisher<Void> ok? I assume only onComplete or onError would be called.
Q2: Which is better, subscribe(Flow.Processor) or subscribe(Flow.Subscriber, Flow.Publisher)?
This is to replace RowPublisherOperation.subscribe(Flow.Subscriber, CompletionStage).
Q3: Assume DataSource extends Flow.Publisher<Session>.
ds.flatMap( s -> {
try(Session session = s.attach()) {
session.<Employee>rowPublisherOperation(sql) . . .
}
});
or
ds.flatMap( session -> {
session.<Employee>rowPublisherOperation(sql) . . .
}
The second requires that session only be valid for the duration of the call to onNext.
The point is that a Session still must be attached and closed. Other alternatives?
Douglas
More information about the jdbc-spec-discuss
mailing list