Class EventStreamSubscriber<T>
java.lang.Object
co.yellowdog.platform.clients.serversentevents.EventStreamSubscriber<T>
- All Implemented Interfaces:
Flow.Subscriber<String>
-
Constructor Summary
ConstructorsConstructorDescriptionEventStreamSubscriber(com.fasterxml.jackson.databind.JavaType javaType, SubscriptionEventListener<T> eventHandler, JsonMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> EventStreamSubscriber<T> ofJson(@NonNull JsonMapper jsonMapper, @NonNull Class<T> javaType, @NonNull SubscriptionEventListener<T> eventHandler) voidvoidvoidvoidonSubscribe(Flow.Subscription subscription)
-
Constructor Details
-
EventStreamSubscriber
public EventStreamSubscriber(com.fasterxml.jackson.databind.JavaType javaType, SubscriptionEventListener<T> eventHandler, JsonMapper jsonMapper)
-
-
Method Details
-
ofJson
public static <T> EventStreamSubscriber<T> ofJson(@NonNull @NonNull JsonMapper jsonMapper, @NonNull @NonNull Class<T> javaType, @NonNull @NonNull SubscriptionEventListener<T> eventHandler) -
onSubscribe
- Specified by:
onSubscribein interfaceFlow.Subscriber<T>
-
onNext
- Specified by:
onNextin interfaceFlow.Subscriber<T>
-
onError
- Specified by:
onErrorin interfaceFlow.Subscriber<T>
-
onComplete
public void onComplete()- Specified by:
onCompletein interfaceFlow.Subscriber<T>
-