Interface ContextSupport

All Known Subinterfaces:
MultiEmitter<T>, UniEmitter<T>, UniSubscriber<T>
All Known Implementing Classes:
AssertSubscriber, MultiSubscriberAdapter, SafeSubscriber, SerializedSubscriber, Subscribers.CallbackBasedSubscriber, SwitchableSubscriptionSubscriber, UniAssertSubscriber, UniDelegatingSubscriber, UniSerializedSubscriber

public interface ContextSupport
Interface for subscribers and types that provide a Context.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Context
    Provide a context.
  • Method Details

    • context

      default Context context()
      Provide a context.

      Since calls to this method shall only be triggered when a Mutiny pipeline uses a withContext operator, there is no need in general for caching the context value in a field of the implementing class. Exceptions include operators that have cross-subscriber semantics such as memoizers or broadcasters.

      This method is expected to be called once per withContext operator.

      Returns:
      the context, must not be null.