Enum Class OnSubscribeDetach.TerminatedProducer

java.lang.Object
java.lang.Enum<OnSubscribeDetach.TerminatedProducer>
rx.internal.operators.OnSubscribeDetach.TerminatedProducer
All Implemented Interfaces:
Serializable, Comparable<OnSubscribeDetach.TerminatedProducer>, Constable, Producer
Enclosing class:
OnSubscribeDetach<T>

static enum OnSubscribeDetach.TerminatedProducer extends Enum<OnSubscribeDetach.TerminatedProducer> implements Producer
Singleton instance via enum.
  • Enum Constant Details

  • Constructor Details

    • TerminatedProducer

      private TerminatedProducer()
  • Method Details

    • values

      public static OnSubscribeDetach.TerminatedProducer[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OnSubscribeDetach.TerminatedProducer valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • request

      public void request(long n)
      Description copied from interface: Producer
      Request a certain maximum number of items from this Producer. This is a way of requesting backpressure. To disable backpressure, pass Long.MAX_VALUE to this method.

      Requests are additive but if a sequence of requests totals more than Long.MAX_VALUE then Long.MAX_VALUE requests will be actioned and the extras may be ignored. Arriving at Long.MAX_VALUE by addition of requests cannot be assumed to disable backpressure. For example, the code below may result in Long.MAX_VALUE requests being actioned only.

       request(100);
       request(Long.MAX_VALUE-1);
       
      Specified by:
      request in interface Producer
      Parameters:
      n - the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace