- 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.SubscriberensuringOnSubscribe,onNext,onErrorandonCompleteto be signaled serially.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSequentialSubscriber(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.SubscriberensuringOnSubscribe,onNext,onErrorandonCompleteto be signaled serially.voidonComplete()voidonError(Throwable throwable)voidonNext(T item)voidonSubscribe(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.SubscriberensuringOnSubscribe,onNext,onErrorandonCompleteto be signaled serially.- Type Parameters:
T- item type- Parameters:
subscriber-Flow.Subscriberto be wrapped.- Returns:
- new
SequentialSubscriber
-
onSubscribe
public void onSubscribe(Flow.Subscription subscription)
- Specified by:
onSubscribein interfaceFlow.Subscriber<T>
-
onNext
public void onNext(T item)
- Specified by:
onNextin interfaceFlow.Subscriber<T>
-
onError
public void onError(Throwable throwable)
- Specified by:
onErrorin interfaceFlow.Subscriber<T>
-
onComplete
public void onComplete()
- Specified by:
onCompletein interfaceFlow.Subscriber<T>
-
-