Skip to main content
Channels enable efficient streaming of large datasets between functions without loading everything into memory.

createChannel()

Create a bidirectional channel for streaming data between workers.
number
default:"64"
Optional buffer size for the channel
Channel
Channel object with writer and reader

Example: Basic Channel Usage

ChannelWriter

Write data to a channel for streaming to another function.

Properties

Writable
Node.js Writable stream for sending data

Methods

sendMessage()

Send a text message through the channel.
string
required
Text message to send

close()

Close the channel writer.

Example: Writing Data

ChannelReader

Read data from a channel streamed by another function.

Properties

Readable
Node.js Readable stream for receiving data

Methods

onMessage()

Register a callback for text messages.
(msg: string) => void
required
Function called for each text message received

Example: Reading Data

Complete Examples

File Processing Pipeline

Large Dataset Transfer

Best Practices

StreamChannelRef

Channel references can be serialized and passed to other functions.
The III SDK automatically converts these references to ChannelReader or ChannelWriter instances when received by function handlers.