public final class EventEmitter
extends java.lang.Object
Component
to communicate with the elastic.io runtime.
The implementation of this class has been inspired by the Node.js
EventEmitter class.Component
Modifier and Type | Class and Description |
---|---|
static class |
EventEmitter.Builder
Used to build
EventEmitter instances. |
static interface |
EventEmitter.Callback
This interface defines a callback to be used by
Executor to pass
errors, data and snapshots to its callee. |
Modifier and Type | Method and Description |
---|---|
EventEmitter |
emitData(Message message)
Emits a
Message . |
EventEmitter |
emitRebound(java.lang.Object reason)
Emits the rebound event specifying a
Object reason. |
EventEmitter |
emitSnapshot(com.google.gson.JsonObject snapshot)
Emits
JsonObject snapshot. |
public EventEmitter emitData(Message message)
Message
.message
- message to emitpublic EventEmitter emitSnapshot(com.google.gson.JsonObject snapshot)
JsonObject
snapshot.snapshot
- snapshot to emitpublic EventEmitter emitRebound(java.lang.Object reason)
Object
reason.reason
- reason for rebound