Module methanol
Class TimeoutSubscriber<T,S extends Flow.Subscriber<? super T>>
java.lang.Object
com.github.mizosoft.methanol.internal.flow.ForwardingSubscriber<T>
com.github.mizosoft.methanol.internal.flow.SerializedForwardingSubscriber<T>
com.github.mizosoft.methanol.internal.flow.TimeoutSubscriber<T,S>
- All Implemented Interfaces:
Flow.Subscriber<T>
- Direct Known Subclasses:
TimeoutBodySubscriber
public abstract class TimeoutSubscriber<T,S extends Flow.Subscriber<? super T>>
extends SerializedForwardingSubscriber<T>
A subscriber that intercepts requests to upstream and schedules error completion if each
requested item isn't received within a timeout.
-
Field Summary
Fields inherited from class com.github.mizosoft.methanol.internal.flow.ForwardingSubscriber
upstream
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected S
Returns the downstream to which signals are forwarded.void
void
void
void
onSubscribe
(Flow.Subscription subscription) protected abstract Throwable
timeoutError
(long index, Duration timeout)
-
Constructor Details
-
TimeoutSubscriber
-
-
Method Details
-
downstream
Description copied from class:ForwardingSubscriber
Returns the downstream to which signals are forwarded.- Specified by:
downstream
in classForwardingSubscriber<T>
-
onSubscribe
- Specified by:
onSubscribe
in interfaceFlow.Subscriber<T>
- Overrides:
onSubscribe
in classSerializedForwardingSubscriber<T>
-
onNext
- Specified by:
onNext
in interfaceFlow.Subscriber<T>
- Overrides:
onNext
in classSerializedForwardingSubscriber<T>
-
onError
- Specified by:
onError
in interfaceFlow.Subscriber<T>
- Overrides:
onError
in classSerializedForwardingSubscriber<T>
-
onComplete
public void onComplete()- Specified by:
onComplete
in interfaceFlow.Subscriber<T>
- Overrides:
onComplete
in classSerializedForwardingSubscriber<T>
-
timeoutError
-