| name | iii-channels |
| description | Binary streaming between workers via channels. Use when building data pipelines, file transfers, streaming responses, or any pattern requiring binary data transfer between functions. |
Channels
Comparable to: Unix pipes, gRPC streaming, WebSocket data streams
Key Concepts
Use the concepts below when they fit the task. Not every worker needs channels.
- A Channel is a WebSocket-backed binary stream between two endpoints (writer and reader)
createChannel() returns a writer/reader pair plus serializable refs that can be passed to other workers
- StreamChannelRef is a serializable reference (channel_id, access_key, direction) that can be included in function payloads
- Writers send binary data and text messages; Node chunks binary writes into 64KB frames
- Readers consume binary chunks incrementally or via
readAll(), and receive text messages via callbacks
- Consumers must construct a reader from a serializable
StreamChannelRef (e.g., ChannelReader::new(...)) rather than using the producer-side reader object returned by createChannel()
- Channels work cross-worker and cross-language — a Python writer can stream to a Rust reader
Architecture
A function creates a channel via createChannel(), receiving a writer and reader pair. The writer ref or reader ref is passed to another function (potentially in a different worker/language) via a trigger payload. The engine brokers the WebSocket connection between the two endpoints. Binary data flows directly between workers through the engine's channel endpoint.
iii Primitives Used