Module org.jooq
Package org.jooq

Interface SubscriberProvider<C>

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 Link icon

    Modifier and Type
    Method
    Description
    Create an empty context.
    context(org.reactivestreams.Subscriber<?> subscriber)
    Extract a context from an existing Subscriber.
    <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 Link icon

    • context Link icon

      @Nullable C context()
      Create an empty context.
    • context Link icon

      @Nullable C context(org.reactivestreams.Subscriber<?> subscriber)
      Extract a context from an existing Subscriber.
    • subscriber Link icon

      @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 of Subscriber.onSubscribe(Subscription)
      onNext - The implementation of Subscriber.onNext(Object)
      onError - The implementation of Subscriber.onError(Throwable)
      onComplete - The implementation of Subscriber.onComplete()
      context - The context()