- All Known Implementing Classes:
DefaultSubscriberProvider
public interface SubscriberProvider<C>
An SPI to allow for overriding the default implementation of
Subscriber
creation in jOOQ.
This SPI can be used to override jOOQ's internal creation of
Subscriber
instances, typically used to create reactor style
context-aware Subscriber
instances. Whatever the
context(Subscriber)
is, it will be propagated to additional
subscriber(Consumer, Consumer, Consumer, Runnable, Object)
calls.
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescriptioncontext()
Create an empty context.context
(org.reactivestreams.Subscriber<?> subscriber) Extract a context from an existingSubscriber
.<T> @NotNull org.reactivestreams.Subscriber
<T> subscriber
(Consumer<? super org.reactivestreams.Subscription> onSubscribe, Consumer<? super T> onNext, Consumer<? super Throwable> onError, Runnable onComplete, C context) Create a new subscriber from its component implementations and a previous context.
-
Method Details
-
context
Create an empty context. -
context
Extract a context from an existingSubscriber
. -
subscriber
@NotNull <T> @NotNull org.reactivestreams.Subscriber<T> subscriber(Consumer<? super org.reactivestreams.Subscription> onSubscribe, Consumer<? super T> onNext, Consumer<? super Throwable> onError, Runnable onComplete, C context) Create a new subscriber from its component implementations and a previous context.- Parameters:
onSubscribe
- The implementation ofSubscriber.onSubscribe(Subscription)
onNext
- The implementation ofSubscriber.onNext(Object)
onError
- The implementation ofSubscriber.onError(Throwable)
onComplete
- The implementation ofSubscriber.onComplete()
context
- Thecontext()
-