Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Fire-and-forget topic pub/sub: broadcast an event with `publish` and every matching `subscribe` trigger receives it. Use for real-time notifications where missed events are acceptable.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -15% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -39% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -4% | 0% |
The iii-pubsub worker is topic-based publish/subscribe messaging. Publish an event to a named topic with the publish function and every registered subscribe trigger whose topic matches is invoked with the raw payload — no envelope, no persistence, no retries. It is fire-and-forget broadcast: subscribers receive each event as it arrives, and a subscriber that is offline simply misses it.
The worker exposes one callable function (publish, registered with the bare function id "publish" — no namespace prefix) and one trigger type (subscribe). Two adapters: local (default; in-memory broadcast channels; only delivers to subscribers in this engine process; no external dependency) and redis (redis_url: ${REDIS_URL:redis://localhost:6379}; uses Redis Pub/Sub so events propagate across multiple engine instances).
redis adapter).iii-queue (topic mode, durable:subscriber) when every consumer must process every event.publish returns topic_not_set, and a subscribe trigger registered with an empty topic never fires.iii-state or iii-stream instead — iii-pubsub carries discrete events, not state.publish — broadcast an event to a topic; every subscribe trigger on that exact topic receives the raw data. Empty topic returns topic_not_set.Bind a subscribe trigger when a function should run every time publish broadcasts to a configured topic. The handler receives the raw data value from the publish call directly — no envelope. Multiple triggers can subscribe to the same topic; each gets an independent copy (true fan-out).
Reach for it when:
redis adapter.If subscribers must reliably process every event with retries and dead-letter handling, use iii-queue's durable:subscriber instead — subscribe is fire-and-forget.
iii.registerFunction('notifications::on-order-shipped', handler).typescriptiii.registerTrigger({ type: 'subscribe', function_id: 'notifications::on-order-shipped', config: { topic: 'orders.shipped', // required, non-empty. Exact match only — no wildcards. }, })
The handler receives the published data unchanged, with no topic field; if one handler serves multiple topics, embed the topic inside data at publish time. The handler's return value is ignored and there is no retry.
For the published payload shape, call iii get function info on publish or the handler function id.
Other measured skills in the registry, with their headline benchmark lift.