Class ServerSentEventSubscriber<K,V>
- java.lang.Object
-
- io.streamthoughts.azkarra.http.sse.ServerSentEventSubscriber<K,V>
-
- Type Parameters:
K
- the record-key typeV
- the record-value type.
- All Implemented Interfaces:
Flow.Subscriber<KV<K,V>>
public class ServerSentEventSubscriber<K,V> extends Object implements Flow.Subscriber<KV<K,V>>
A subscriber that sent publishedKV
records over HTTP using a Server-Sent Event (SSE) connection.- Since:
- 0.8.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ServerSentEventSubscriber.StreamedEvent
-
Constructor Summary
Constructors Constructor Description ServerSentEventSubscriber(io.undertow.server.handlers.sse.ServerSentEventConnection connection, String eventType, String applicationId, Json json)
Creates a newServerSentEventSubscriber
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onComplete()
void
onError(Throwable throwable)
void
onNext(KV<K,V> record)
void
onSubscribe(Flow.Subscription subscription)
-
-
-
Constructor Detail
-
ServerSentEventSubscriber
public ServerSentEventSubscriber(io.undertow.server.handlers.sse.ServerSentEventConnection connection, String eventType, String applicationId, Json json)
Creates a newServerSentEventSubscriber
instance.- Parameters:
connection
- theServerSentEventConnection
.eventType
- the event type.applicationId
- theapplication.id
of KafkaStreams, used for logging.json
- theJson
serializer.
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Flow.Subscription subscription)
- Specified by:
onSubscribe
in interfaceFlow.Subscriber<K>
-
onError
public void onError(Throwable throwable)
- Specified by:
onError
in interfaceFlow.Subscriber<K>
-
onComplete
public void onComplete()
- Specified by:
onComplete
in interfaceFlow.Subscriber<K>
-
-