Package io.deephaven.plugin.type
Interface ObjectType.MessageStream
- Enclosing interface:
- ObjectType
public static interface ObjectType.MessageStream
A stream of messages, either sent from the server to the client, or client to the server. ObjectType plugin
implementations provide an instance of this interface for each incoming stream to invoke as messages arrive, and
will likewise be given an instance of this interface to be able to send messages to the client.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ObjectType.MessageStreamSimple stream that does no handling on data or close. -
Method Summary
Modifier and TypeMethodDescriptionvoidonClose()Closes the stream on both ends.voidonData(ByteBuffer payload, Object... references) Transmits/receives data to/from the remote end of the stream.
-
Field Details
-
NOOP
Simple stream that does no handling on data or close.
-
-
Method Details
-
onData
Transmits/receives data to/from the remote end of the stream. This can consist of a binary payload and references to objects on the server.
When implementing this interface for a plugin, this method will be invoked when a request arrives from the client. When invoking this method from in a plugin, it will send a response to the client.
Note that sending a message can cause an exception if there is an error in serializing, and for that reason this method throws a checked exception. It is safe to let that propagate up through either an incomingonData call from a client, or thecall to create the stream, but it is usually unsafe to let this propagate to other engine threads.- Parameters:
payload- the binary data sent to the remote implementationreferences- server-side object references sent to the remote implementation- Throws:
ObjectCommunicationException- a checked exception for any errors that may occur, to ensure that the error is handled without propagating.
-
onClose
void onClose()Closes the stream on both ends. No further messages can be sent or received.
-