- java.lang.Object
-
- io.helidon.common.reactive.SequentialSubscriber<T>
-
- Type Parameters:
T
- Type of the item
- All Implemented Interfaces:
Flow.Subscriber<T>
public class SequentialSubscriber<T> extends Object implements Flow.Subscriber<T>
WrapperFlow.Subscriber
ensuringOnSubscribe
,onNext
,onError
andonComplete
to be signaled serially.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SequentialSubscriber(Flow.Subscriber<T> subscriber)
Provides protection from untrusted publishers, enforces rule 1.3 by serializing all parallel calls.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> SequentialSubscriber<T>
create(Flow.Subscriber<T> subscriber)
WrapperFlow.Subscriber
ensuringOnSubscribe
,onNext
,onError
andonComplete
to be signaled serially.void
onComplete()
void
onError(Throwable throwable)
void
onNext(T item)
void
onSubscribe(Flow.Subscription subscription)
-
-
-
Constructor Detail
-
SequentialSubscriber
protected SequentialSubscriber(Flow.Subscriber<T> subscriber)
Provides protection from untrusted publishers, enforces rule 1.3 by serializing all parallel calls.- Parameters:
subscriber
- to be protected
-
-
Method Detail
-
create
public static <T> SequentialSubscriber<T> create(Flow.Subscriber<T> subscriber)
WrapperFlow.Subscriber
ensuringOnSubscribe
,onNext
,onError
andonComplete
to be signaled serially.- Type Parameters:
T
- item type- Parameters:
subscriber
-Flow.Subscriber
to be wrapped.- Returns:
- new
SequentialSubscriber
-
onSubscribe
public void onSubscribe(Flow.Subscription subscription)
- Specified by:
onSubscribe
in interfaceFlow.Subscriber<T>
-
onNext
public void onNext(T item)
- Specified by:
onNext
in interfaceFlow.Subscriber<T>
-
onError
public void onError(Throwable throwable)
- Specified by:
onError
in interfaceFlow.Subscriber<T>
-
onComplete
public void onComplete()
- Specified by:
onComplete
in interfaceFlow.Subscriber<T>
-
-