Module methanol
Class AsyncSubscriberAdapter<T,S extends Flow.Subscriber<? super List<ByteBuffer>>>
java.lang.Object
com.github.mizosoft.methanol.internal.flow.ForwardingSubscriber<List<ByteBuffer>>
com.github.mizosoft.methanol.internal.extensions.AsyncSubscriberAdapter<T,S>
- Type Parameters:
T- the body typeS- the subscriber's type
- All Implemented Interfaces:
HttpResponse.BodySubscriber<T>,Flow.Subscriber<List<ByteBuffer>>
public final class AsyncSubscriberAdapter<T,S extends Flow.Subscriber<? super List<ByteBuffer>>>
extends ForwardingSubscriber<List<ByteBuffer>>
implements HttpResponse.BodySubscriber<T>
Adapts a subscriber to a
BodySubscriber where the body's completion need not be in
accordance with onComplete or onError.-
Field Summary
Fields inherited from class com.github.mizosoft.methanol.internal.flow.ForwardingSubscriber
upstream -
Constructor Summary
ConstructorsConstructorDescriptionAsyncSubscriberAdapter(S downstream, Function<? super S, ? extends CompletionStage<T>> asyncFinisher) -
Method Summary
Modifier and TypeMethodDescriptionprotected Flow.Subscriber<? super List<ByteBuffer>> delegate()Returns the downstream to which signals are forwarded.getBody()Methods inherited from class com.github.mizosoft.methanol.internal.flow.ForwardingSubscriber
onComplete, onError, onNext, onSubscribe, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.Flow.Subscriber
onComplete, onError, onNext, onSubscribe
-
Constructor Details
-
AsyncSubscriberAdapter
public AsyncSubscriberAdapter(S downstream, Function<? super S, ? extends CompletionStage<T>> asyncFinisher)
-
-
Method Details
-
delegate
Description copied from class:ForwardingSubscriberReturns the downstream to which signals are forwarded.- Specified by:
delegatein classForwardingSubscriber<List<ByteBuffer>>
-
getBody
- Specified by:
getBodyin interfaceHttpResponse.BodySubscriber<T>
-