iii-stream
ما الذي تفعله
تخزّن هذه المهارة بيانات فورية في تدفقات مُسماة، وتدفع التغييرات إلى العملاء المشتركين، فلا تحتاج الميزات الحية إلى استطلاع دوري. وهي موجهة لمطوّري أنظمة iii القائمة، لأن هذا العامل مُهمَل وسيُحذف.
متى تستخدمها
- ✓عندما تصون نظام iii قائماً يستخدم التدفقات أصلاً.
- ✓عندما تحتاج إلى بث حي يدفع التحديثات إلى المشتركين.
- ✓عندما تخطط لنقل ميزة بث إلى نهج أحدث.
رابط المهارة
https://github.com/iii-hq/iii/blob/main/engine/src/workers/stream/skills/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أرني كيف يدفع تدفق iii موجود التحديثات إلى العملاء المشتركين، حتى أخطط للانتقال.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يخزن العامل العناصر في بنية من ثلاثة مستويات، ويرسل كل تغيير إلى العملاء المشتركين في ذلك التدفق. ويمكن تشغيل فحص تفويض عند انضمام عميل. وسلوكه لم يتغير حتى الآن، ويرتبط دليل الانتقال من وثائقه.
المحتوى التقني (ملف 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
- الترخيص
- —
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
iii-sandbox
19kيساعد وكيلك على تشغيل كود غير موثوق أو مولّد بالذكاء الاصطناعي داخل جهاز افتراضي معزول ومؤقت، ثم يُتخلص منه بعد الانتهاء.
configuration
19kيتيح لوكيلك إعداد سجل مشترك لقيم إعدادات مُسماة، يُتحقَّق منها بمخطط، فيقرأها العمال ويتفاعلون مع تغييراتها.
iii
19kيعلّم وكيلك كيف تعمل عمال iii، فيستطيع إضافة قدرة بالتحقق أولاً مما هو موجود، ثم بناء عامل جديد عند الحاجة.
iii-observability
19kيساعد وكيلك على إضافة التتبع والسجلات المنظمة والمقاييس والتنبيهات إلى محرك iii، باستخدام OpenTelemetry لترى ما يحدث في نظامك.
مهارات مشابهة
api-connector-builder
280kيبني وكيلك اتصالات API جديدة على النمط الموجود، ويفيد عندما تحتاج إلى تكامل إضافي دون ابتكار طريقة جديدة للعمل.
api-design
280kيساعد وكيلك على تصميم واجهات REST API وفق أفضل الممارسات، ويوضح كيف تتواصل وكيف تُعرض الأخطاء وكيف تُنظَّم البيانات.
backend-patterns
280kيساعد وكيلك على أنماط بنية الخادم وتحسين قاعدة البيانات، ويفيد في بناء الشيفرة التي تعمل على الخادم أو مراجعتها.