Class Operators.DeferredSubscription

java.lang.Object
reactor.core.publisher.Operators.DeferredSubscription
All Implemented Interfaces:
Subscription, Scannable
Enclosing class:
Operators

public static class Operators.DeferredSubscription extends Object implements Subscription, Scannable
Base class for Subscribers that will receive their Subscriptions at any time, yet they might also need to be cancelled or requested at any time.
  • Constructor Details

    • DeferredSubscription

      public DeferredSubscription()
  • Method Details

    • isCancelled

      protected boolean isCancelled()
    • cancel

      public void cancel()
      Specified by:
      cancel in interface Subscription
    • terminate

      protected void terminate()
    • scanUnsafe

      public @Nullable Object scanUnsafe(Scannable.Attr key)
      Description copied from interface: Scannable
      This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the Scannable.Attr key, implementors should take care to return values of the correct type, and return null if no specific value is available.

      For public consumption of attributes, prefer using Scannable.scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

      Specified by:
      scanUnsafe in interface Scannable
      Parameters:
      key - a Scannable.Attr to resolve for the component.
      Returns:
      the value associated to the key for that specific component, or null if none.
    • request

      public void request(long n)
      Specified by:
      request in interface Subscription
    • set

      public final boolean set(Subscription s)
      Atomically sets the single subscription and requests the missed amount from it.
      Parameters:
      s - the subscription to set
      Returns:
      false if this arbiter is cancelled or there was a subscription already set