astrid-events
Event bus for the Astrid secure agent runtime SDK.
Overview
This crate provides event types and a broadcast-based event bus for communicating runtime operations across the Astrid system.
Features
- Event Types: Comprehensive event types for all runtime operations
- Broadcast Event Bus: Async event distribution to multiple subscribers
- Dual Subscription Modes:
- Async receivers via
bus.subscribe()for polling - Synchronous handlers via
EventSubscribertrait for callbacks
- Async receivers via
- Event Filtering: Filter events by type with
FilterSubscriber - Subscriber Registry: Manage synchronous handler registrations
Usage
Async Subscription
use ;
async
Synchronous Subscription
use ;
;
let registry = new;
registry.register;
Key Exports
| Export | Description |
|---|---|
EventBus |
Broadcast-based event distribution |
EventReceiver |
Async receiver for subscribed events |
AstridEvent |
Enum of all event types |
EventMetadata |
Common metadata for events |
EventSubscriber |
Trait for synchronous handlers |
SubscriberRegistry |
Registry for synchronous subscribers |
License
This crate is licensed under the MIT license.