iii-stream
하는 일
이 스킬은 실시간 데이터를 이름 있는 스트림에 저장하고, 변경 사항을 연결된 클라이언트에 밀어 보내므로 실시간 기능에 폴링이 필요하지 않습니다. 이 워커는 지원 중단되어 제거될 예정이므로, 기존 iii 시스템을 유지보수하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓이미 스트림을 쓰는 기존 iii 시스템을 유지보수할 때.
- ✓구독자에게 업데이트를 밀어 보내는 실시간 피드가 필요할 때.
- ✓스트리밍 기능을 더 새로운 방식으로 옮길 계획이 있는 경우.
스킬 링크
https://github.com/iii-hq/iii/blob/main/engine/src/workers/stream/skills/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“기존 iii 스트림이 구독한 클라이언트에 업데이트를 어떻게 보내는지 보여 주셔서, 이전 계획을 세울 수 있게 해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
워커는 항목을 세 단계 구조에 저장하고, 각 변경을 그 스트림을 구독한 클라이언트에 보냅니다. 클라이언트가 들어올 때 인가 검사를 실행할 수 있습니다. 지금은 동작이 바뀌지 않았으며, 이전 안내는 문서에 연결되어 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
이 워커는 아직 지원되나요?
지원 중단되었고 곧 제거될 예정이지만, 지금은 동작이 바뀌지 않았습니다.
이전 안내서는 어디 있나요?
워커 문서가 iii 사이트의 마이그레이션 가이드로 연결됩니다.
여러 서버 프로세스에서 실행할 수 있나요?
Redis 어댑터를 쓸 때만 가능합니다. 기본 저장소는 프로세스 사이에 업데이트를 공유하지 않습니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 19k
- 순위
- #10489
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
iii-sandbox
19k에이전트가 신뢰할 수 없거나 AI가 만든 코드를 임시 격리 가상 머신 안에서 안전하게 실행하고, 끝나면 버리도록 돕습니다.
configuration
19k에이전트가 스키마로 검사하는 이름 있는 설정 값의 공유 레지스트리를 만들도록 돕습니다. 워커가 변경을 읽고 반응할 수 있습니다.
iii
19k에이전트가 iii 워커의 작동 방식을 익혀, 먼저 이미 있는 기능을 확인한 뒤 워커를 만들어 기능을 추가하도록 가르칩니다.
iii-observability
19k에이전트가 iii 엔진에 추적, 구조화된 로그, 지표, 알림을 추가하도록 돕습니다. OpenTelemetry를 써서 시스템에서 무슨 일이 일어나는지 볼 수 있습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.