PayloadSender class
Streaming payload sender.
Properties
disconnected | |
is |
Get current connected state |
Methods
connect(ITransport |
Connects to the given transport sender. |
disconnect(Transport |
Disconnects this payload sender. |
send |
Sends a payload out over the connected transport sender. |
Property Details
disconnected
isConnected
Get current connected state
boolean isConnected
Property Value
boolean
true if connected to a transport sender.
Method Details
connect(ITransportSender)
Connects to the given transport sender.
function connect(sender: ITransportSender)
Parameters
- sender
- ITransportSender
The transport sender to connect this payload sender to.
disconnect(TransportDisconnectedEvent)
Disconnects this payload sender.
function disconnect(event?: TransportDisconnectedEvent)
Parameters
The disconnected event arguments to include in the disconnected event broadcast.
sendPayload(IHeader, SubscribableStream, () => Promise<void>)
Sends a payload out over the connected transport sender.
function sendPayload(header: IHeader, payload?: SubscribableStream, sentCallback?: () => Promise<void>)
Parameters
- header
- IHeader
The header to attach to the outgoing payload.
- payload
- SubscribableStream
The stream of buffered data to send.
- sentCallback
-
() => Promise<void>
The function to execute when the send has completed.