Skip to main content

Event API

EventBus provides process-local publish/subscribe routing with fnmatch or optional MQTT wildcards (+, #), cursor-tracked polling (poll), targeted agent inboxes (inbox.<recipient>), and host subscriber callbacks across all six SDKs. Event payloads must be finite JSON values.

from ish import EventBus

bus = EventBus()
subscription = bus.subscribe("infra.*")
bus.publish_sync("infra.database.failover", {"primary_node": "db-02", "status": "active"})
page = bus.poll(subscription)
print(page["messages"])

Subscribe, publish, poll​

Operations, payload shape​

An event bus delivers notifications to live subscribers and keeps a pollable in-process history. A mailbox is a queue for a target agent. The in-memory BoundedMailbox applies a size limit but does not survive process exit; DurableMailbox stores queued messages in SQLite so they can be recovered after a restart.

OperationPythonTypeScript / C# / Java / GoRust (ish_harness::EventBus)
Create busEventBus()new EventBus(client) / NewEventBusEventBus::new()
Subscribesubscribe(topic, handler?)subscribe(pattern) / Subscribesubscribe(pattern)
Publishpublish / publish_syncpublish(topic, payload, source) / Publishpublish_event(topic, source, payload)
Poll cursorpoll(subscription, limit?)poll(subscription, limit) / PollReceive via rx.recv() / try_recv()
Targeted inboxsend_to / poll_inboxpublish("inbox.<agent>", ...) + inboxpublish_event("inbox.<agent>", ...) + poll_inbox

Each delivered event carries event_id, topic, source, payload, and timestamp. See EventBus for host callbacks and BoundedMailbox / DurableMailbox queue durability.

EventBus agent tools​

Use events.agent_tools to obtain the shared publish_event, send_message, and check_inbox schemas, then mount them in an agent request. events.tool_action handles the common actions and inbox response text in Rust across SDKs.