Client
is a facade that provide convenient interface to process data stream, and unitesStreamer
andConsumer
under implementation.Streamer
fills the events' channelHttpConnection
establish, controls and watches connections, throw error (notify stream) if connection brokenStreamReader
read bytes lines from the response stream, detect data messages and corespondent IDEventParser
parse event type from byte data, return event type and raw data
Consumer
read events stream and delegate to process each to the specific handlerHandler
acceptsRawEvent
for certain type, parse body, provide business logic
- Work with context
- Can run async consumers (
Test_Example_With5Workers
examples) - Fully configurable (http options) (check
Test_SSE_WithConfigurations
in examples) Streamer
andConsumer
can work independently- Error handling flexible, the caller should control a behavior (examples)
- Supports middleware (
Test_Example_WithMiddleware
in examples) Flow control
will notify caller if worker works too slow in compare to streamer. (Test_Example_CloseSlowConsuming
in examples)
- Doesn't support failure tolerance out of the box. The caller should control consistency of the data and provide reconnection strategy on top of the client.
- Doesn't support distributed transactions. This is a caller responsibility to control behavior of partial processed events.
- Consumers can work async, but in this case this is a caller responsibility to control order of processed events, handle errors and observe the consistency.
For details of the advanced usage please check examples