PayloadSender class

Streaming payload sender.

Properties

disconnected
isConnected

Get current connected state

Methods

connect(ITransportSender)

Connects to the given transport sender.

disconnect(TransportDisconnectedEvent)

Disconnects this payload sender.

sendPayload(IHeader, SubscribableStream, () => Promise<void>)

Sends a payload out over the connected transport sender.

Property Details

disconnected

disconnected?: TransportDisconnectedEventHandler

Property Value

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

event
TransportDisconnectedEvent

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.