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) void
void
void
void
onSubscribe
(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:
onSubscribe
in interfaceFlow.Subscriber<T>
-
onNext
- Specified by:
onNext
in interfaceFlow.Subscriber<T>
-
onError
- Specified by:
onError
in interfaceFlow.Subscriber<T>
-
onComplete
public void onComplete()- Specified by:
onComplete
in interfaceFlow.Subscriber<T>
-