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
ConstructorDescriptionAsyncSubscriberAdapter
(S downstream, Function<? super S, ? extends CompletionStage<T>> asyncFinisher) -
Method Summary
Modifier and TypeMethodDescriptionprotected Flow.Subscriber
<? super List<ByteBuffer>> Returns the downstream to which signals are forwarded.getBody()
Methods inherited from class com.github.mizosoft.methanol.internal.flow.ForwardingSubscriber
onComplete, onError, onNext, onSubscribe
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
downstream
Description copied from class:ForwardingSubscriber
Returns the downstream to which signals are forwarded.- Specified by:
downstream
in classForwardingSubscriber<List<ByteBuffer>>
-
getBody
- Specified by:
getBody
in interfaceHttpResponse.BodySubscriber<T>
-