Expand description
Subscription system for continuous event sources.
Subscriptions provide a declarative way to receive events from external sources like timers, file watchers, or network connections. The runtime manages subscription lifecycles automatically based on what the model declares as active.
§How it works
Model::subscriptions()returns the set of active subscriptions- After each
update(), the runtime compares active vs previous subscriptions - New subscriptions are started, removed ones are stopped
- Subscription messages are routed through
Model::update()
Structs§
- Every
- A subscription that fires at a fixed interval.
- File
Watcher - A subscription that reports changes to one filesystem path.
- Stop
Signal - Signal for stopping a subscription.
Enums§
- File
Event - What a
FileWatcherobserved between two polls of its path.
Traits§
- Subscription
- A subscription produces messages from an external event source.
Functions§
- file_
watcher - Boxed file watcher: the one-liner for
subscriptions(). - tick_
every - Boxed tick subscription: the one-liner for
subscriptions().
Type Aliases§
- SubId
- A unique identifier for a subscription.