iii-stream
Qué hace
Guarda datos en tiempo real en flujos con nombre y envía los cambios a los clientes conectados, para que las funciones en vivo no necesiten consultar. Es para desarrolladores que mantienen sistemas iii existentes, ya que este worker está obsoleto y se eliminará.
Cuándo usarla
- ✓Cuando mantienes un sistema iii existente que ya usa flujos.
- ✓Cuando necesitas un feed en vivo que envíe actualizaciones a los suscriptores.
- ✓Cuando planeas migrar una función de streaming a un enfoque más nuevo.
Link de la skill
https://github.com/iii-hq/iii/blob/main/engine/src/workers/stream/skills/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Muéstrame cómo un flujo existente de iii envía actualizaciones a los clientes suscritos, para poder planificar la migración.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El worker guarda los elementos en una estructura de tres niveles y envía cada cambio a los clientes suscritos a ese flujo. Puede ejecutarse una comprobación de autorización cuando un cliente se une. Su comportamiento no cambia por ahora, y la guía de migración está enlazada desde su documentación.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
iii-stream
Deprecated. iii-stream is deprecated (iii-stream) and will be removed in an upcoming release. Behavior is unchanged for now. Migration guide: https://iii.dev/docs/upgrading/migrate-from-streams
The iii-stream worker stores real-time data as a three-level hierarchy (stream_name -> group_id -> item_id) in the configured adapter and exposes two surfaces: a CRUD-shaped stream::* function namespace for reading and writing items, and reactive trigger types (stream, stream:join, stream:leave) that fire on data changes and on WebSocket subscriber connect/disconnect. Reactive backends are built by binding handlers to those triggers rather than by polling.
A write persists the new value, dispatches matching stream triggers on a spawned task (fire-and-forget, so the originating call returns before handlers finish), and broadcasts the change to every WebSocket client subscribed to that (stream_name, group_id). The stream:join trigger doubles as an authorization gate: returning { unauthorized: true } from its handler rejects the subscription before any data flows. Pair it with the worker's auth_function config, which runs once per WebSocket handshake and stamps a context value into every join/leave event.
Adapters: kv (default; in-memory or file-backed; single-instance only, no cross-process fan-out) or redis (required for multi-instance fleets that need real-time fan-out). Browser and client subscriptions use the Browser SDK (iii-browser-sdk), which subscribes to stream changes over a single engine WebSocket. Connecting directly to the stream port (ws://host:{port}/stream/{stream_name}/{group_id}) is deprecated in favor of the Browser SDK.
When to Use
- A stream change should kick off side effects elsewhere (derived projections, audit logs, notifications) without polling
stream::list. - You need to gate WebSocket subscriptions server-side instead of trusting client-side filtering.
- You want server-side reactions to subscriber connect/disconnect for presence counters, per-subscription rate buckets, or audit trails.
- An item needs atomic partial updates that concurrent writers would otherwise race on.
Boundaries
- Not a general key/value store — data is stream-shaped (
stream_name/group_id/item_id). Use the standalonestateworker for scope/key values. - The default
kvadapter does not fan out across processes; multi-instance fleets that need real-time broadcast must useredis. stream:leaveis not an authorization gate — the subscription is already gone by the time it fires, and its return value is ignored.- Trigger handlers run after the originating write returns; a handler failure neither rolls back the write nor surfaces to the caller.
Functions
stream::set— persist an item and broadcast a create/update event; returns the previous value alongside the new one.stream::update— atomically apply orderedset/merge/increment/decrement/append/removeops to an existing item.stream::delete— remove an item and broadcast a delete event carrying the removed value.stream::send— broadcast a transient event to a group's subscribers without persisting it (typing indicators, cursor positions).stream::get— read one item by its full(stream, group, item)triple.stream::list— enumerate items in a group.stream::list_groups— enumerate groups in a stream.stream::list_all— enumerate every stream's metadata.
Reactive triggers
Bind a stream-family trigger when a function should run automatically on stream activity — without polling stream::list. Three types cover two concerns: stream reacts to data changes, while stream:join / stream:leave react to WebSocket subscriber lifecycle.
Reach for them when:
- A
set/update/delete/sendshould drive a projection, audit log, or downstream notification. - Subscriptions need server-side authorization (
stream:join) or paired setup/teardown (stream:join+stream:leave).
If you only need the current value on demand, call stream::get instead of binding a trigger.
How to bind
- Register a handler:
iii.registerFunction('presence::on-change', handler). - Register the trigger:
iii.registerTrigger({
type: 'stream',
function_id: 'presence::on-change',
config: {
stream_name: 'presence', // required for `stream`; the worker indexes triggers by it.
group_id: 'room-1', // optional. Empty/omitte
Preguntas frecuentes
¿Sigue teniendo soporte este worker?
Está obsoleto y se eliminará en una próxima versión, aunque su comportamiento no cambia por ahora.
¿Dónde está la guía de migración?
La documentación del worker enlaza con una guía de migración en el sitio de iii.
¿Puede funcionar entre varios procesos del servidor?
Solo con el adaptador de Redis, ya que el almacenamiento predeterminado no comparte actualizaciones entre procesos.
Detalles
Descripción original del autor
Durable real-time streams with a CRUD function surface plus reactive triggers that fire on item changes and WebSocket subscriber lifecycle — reach for it to build live backends without polling. iii-stream is deprecated (iii-stream) and will be removed in an upcoming release. Behavior is unchanged for now. Migration guide: https://iii.dev/docs/upgrading/migrate-from-streams
repo: iii-hq/iii
Popularidad
- Estrellas en GitHub
- 19 mil
- Posición en el ranking
- #10489
- Licencia
- —
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
iii-sandbox
19 milAyuda a tu agente a ejecutar código no fiable o generado por IA de forma segura dentro de una máquina virtual aislada y temporal, y descartarla al terminar.
configuration
19 milPermite que tu agente configure un registro compartido de valores de configuración con nombre, validados contra un esquema, para que los workers puedan leer los cambios y reaccionar a ellos.
iii
19 milEnseña a tu agente cómo funcionan los workers de iii, para que pueda añadir una capacidad comprobando primero lo que ya existe y después construyendo un worker.
iii-observability
19 milAyuda a tu agente a añadir trazado, registros estructurados, métricas y alertas a un motor iii, usando OpenTelemetry para que puedas ver lo que está pasando.
Skills parecidas
api-connector-builder
280 milHace que tu agente cree nuevas conexiones de API siguiendo el patrón existente. Úsalo para añadir una integración más sin inventar otra forma de hacer las cosas.
api-design
280 milAyuda a tu agente a diseñar APIs REST según las buenas prácticas. Es útil para definir cómo se comunican las APIs, cómo se muestran los errores y cómo organizar los datos.
backend-patterns
280 milAyuda a tu agente con patrones de arquitectura del lado del servidor y optimización de bases de datos. Es útil para crear o revisar código que se ejecuta en el servidor.