Module methanol

Class AsyncSubscriberAdapter<T,​S extends java.util.concurrent.Flow.Subscriber<? super java.util.List<java.nio.ByteBuffer>>>

  • Type Parameters:
    T - the body type
    S - the subscriber's type
    All Implemented Interfaces:
    java.net.http.HttpResponse.BodySubscriber<T>, java.util.concurrent.Flow.Subscriber<java.util.List<java.nio.ByteBuffer>>

    public final class AsyncSubscriberAdapter<T,​S extends java.util.concurrent.Flow.Subscriber<? super java.util.List<java.nio.ByteBuffer>>>
    extends ForwardingSubscriber<java.util.List<java.nio.ByteBuffer>>
    implements java.net.http.HttpResponse.BodySubscriber<T>
    Adapts a subscriber to a BodySubscriber where the body's completion need not be in accordance with onComplete or onError.
    • Constructor Summary

      Constructors 
      Constructor Description
      AsyncSubscriberAdapter​(S downstream, java.util.function.Function<? super S,​? extends java.util.concurrent.CompletionStage<T>> asyncFinisher)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.concurrent.Flow.Subscriber<? super java.util.List<java.nio.ByteBuffer>> delegate()
      Returns the downstream to which signals are forwarded.
      java.util.concurrent.CompletionStage<T> getBody()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.concurrent.Flow.Subscriber

        onComplete, onError, onNext, onSubscribe
    • Constructor Detail

      • AsyncSubscriberAdapter

        public AsyncSubscriberAdapter​(S downstream,
                                      java.util.function.Function<? super S,​? extends java.util.concurrent.CompletionStage<T>> asyncFinisher)
    • Method Detail

      • delegate

        protected java.util.concurrent.Flow.Subscriber<? super java.util.List<java.nio.ByteBuffer>> delegate()
        Description copied from class: ForwardingSubscriber
        Returns the downstream to which signals are forwarded.
        Specified by:
        delegate in class ForwardingSubscriber<java.util.List<java.nio.ByteBuffer>>
      • getBody

        public java.util.concurrent.CompletionStage<T> getBody()
        Specified by:
        getBody in interface java.net.http.HttpResponse.BodySubscriber<T>