Skip to main content
Channels enable streaming data transfer between workers in a distributed III application. They provide bidirectional communication with reader and writer endpoints.

Channel

A streaming channel pair created by createChannel(), containing both local handles and serializable references.

Fields

ChannelWriter
required
Local writer for sending data through the channel.
ChannelReader
required
Local reader for receiving data from the channel.
StreamChannelRef
required
Serializable reference to the writer endpoint. Pass this to other workers to allow them to write to this channel.
StreamChannelRef
required
Serializable reference to the reader endpoint. Pass this to other workers to allow them to read from this channel.

StreamChannelRef

A serializable reference to a channel endpoint that can be passed in function invocation data.

Fields

string
required
Unique identifier for the channel.
string
required
Secret access key for authenticating to the channel endpoint.
'read' | 'write'
required
Whether this reference is for reading from or writing to the channel.

ChannelWriter

Writer endpoint for sending data through a channel.

Properties

WritableStream
required
Node.js Writable stream interface for sending binary data.

Methods

function
Write binary data to the channel. Data is automatically chunked into frames.
function
Send a text message through the channel (separate from binary data stream).
function
Close the writer endpoint and signal completion to the reader.

ChannelReader

Reader endpoint for receiving data from a channel.

Properties

ReadableStream
required
Node.js Readable stream interface for receiving binary data.

Methods

function
Register a callback to receive text messages (separate from binary data stream).
function
Read the next binary chunk from the channel. Returns None when stream is closed.
function
Read the entire stream into a single buffer.
function
Close the reader endpoint.

Usage Examples

Basic Channel Communication

Receiving Channel Reference

Streaming Large Files

Configuration

Buffer Size

When creating a channel, you can optionally specify a buffer size:
Default: 64 messages The buffer size determines how many messages can be queued in the channel before backpressure is applied to the writer.