T - type to decode events intopublic class Stream<T> extends Object
EventStream.
Clean interface to read events from a stream as some type T.| Constructor and Description |
|---|
Stream(EventStream eventStream,
Class<T> resultClass,
CodecRegistry codecRegistry) |
Stream(EventStream eventStream,
Decoder<T> decoder) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Close the underlying connection to the event stream.
|
void |
close()
Close the underlying event stream.
|
boolean |
isOpen()
Whether or not the underlying event straem is still open.
|
StitchEvent<T> |
nextEvent()
Fetch the next event from a given stream
|
public Stream(EventStream eventStream, Decoder<T> decoder)
public Stream(EventStream eventStream, Class<T> resultClass, CodecRegistry codecRegistry)
public StitchEvent<T> nextEvent() throws Exception
Exception - any exception that could occurpublic boolean isOpen()
public void close()
throws IOException
IOException - i/o exceptions relative to closingpublic void cancel()