con un clic
iii-channels
// Binary streaming between workers via channels. Use when building data pipelines, file transfers, streaming responses, or any pattern requiring binary data transfer between functions.
// Binary streaming between workers via channels. Use when building data pipelines, file transfers, streaming responses, or any pattern requiring binary data transfer between functions.
Browser SDK for connecting to the iii engine from web applications via WebSocket. Use when building browser-based clients that register functions, invoke triggers, or consume streams from the frontend.
Registers cron triggers with 7-field expressions to run functions on recurring schedules. Use when scheduling periodic jobs, timed automation, crontab replacements, cleanup routines, report generation, batch processing, or calendar-based work that is genuinely time-driven.
Builds custom trigger types for events iii does not handle natively. Use when integrating webhooks, file watchers, IoT devices, database CDC, or any external event source.
Configures the iii engine via iii-config.yaml — workers, adapters, queue configs, ports, and environment variables. Use when deploying, tuning, or customizing the engine.
Handle iii engine and SDK errors across Node, Python, Rust, and browser workers. Use when interpreting error codes, retryability, RBAC denial, timeouts, handler failures, or SDK-specific exception surfaces.
Registers functions and triggers on the iii engine across TypeScript, Python, and Rust. Use when creating workers, registering function handlers, binding triggers, or invoking functions across languages.
| 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. |
Comparable to: Unix pipes, gRPC streaming, WebSocket data streams
Use the concepts below when they fit the task. Not every worker needs channels.
createChannel() returns a writer/reader pair plus serializable refs that can be passed to other workersreadAll(), and receive text messages via callbacksStreamChannelRef (e.g., ChannelReader::new(...)) rather than using the producer-side reader object returned by createChannel()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.
| Primitive | Purpose |
|---|---|
createChannel(bufferSize?) | Create a channel, returns writer + reader pair |
ChannelWriter.write(data) | Send binary data (chunked into 64KB frames) |
ChannelWriter.sendMessage(msg) | Send a text message through the channel |
ChannelWriter.close() | Close the writer end |
ChannelReader.readAll() | Read entire stream into a single buffer |
ChannelReader.onMessage(callback) | Register callback for text messages |
StreamChannelRef | Serializable reference to pass between workers |
channel.writer.stream.write(buffer), channel.writer.sendMessage(text), channel.reader.stream, channel.reader.readAll(), channel.reader.onMessage(callback).iii.create_channel(), writer.write(bytes), writer.send_message(text), reader.read_all(), reader.on_message(callback).await iii.create_channel_async(), await writer.send_message_async(text), async iteration over reader.iii.create_channel(None).await, ChannelReader::new(engine_ws_base, &reader_ref), ChannelWriter::new(engine_ws_base, &writer_ref), next_binary(), read_all(), extract_channel_refs(&value).createChannel(), writer.sendBinary(uint8Array), writer.sendMessage(text), reader.onBinary(callback), reader.onMessage(callback), reader.readAll().Each reference shows the same patterns (channel creation, binary streaming, text messages, cross-function handoff) in its respective language.
Code using this pattern commonly includes, when relevant:
const channel = await iii.createChannel() — create a channel pair (producer access)channel.writer.stream.write(buffer) / channel.writer.write(data) — send binary datachannel.writer.sendMessage(JSON.stringify({ type: 'metadata', ... })) — send text metadatachannel.writer.close() — signal end of streamchannel.readerRef or channel.writerRef in trigger payloads for cross-worker streamingChannelReader::new(engine_ws_base, &reader_ref)const data = await reader.readAll() — read entire stream (consumer behavior)reader.onMessage(msg => { ... }) — handle text messages (consumer behavior)Use the adaptations below when they apply to the task.
readerRef to a processing function and writerRef to a producing function for pipeline patternsbufferSize when the reader may be slower than the writer to apply backpressureiii-state-management.iii-realtime-streams.subscribe type.iii-channels when the primary problem is binary data streaming between workers.iii-channels in the iii engine.