Skip to main content

Module subscription

Module subscription 

Source
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

  1. Model::subscriptions() returns the set of active subscriptions
  2. After each update(), the runtime compares active vs previous subscriptions
  3. New subscriptions are started, removed ones are stopped
  4. Subscription messages are routed through Model::update()

Structs§

Every
A subscription that fires at a fixed interval.
FileWatcher
A subscription that reports changes to one filesystem path.
StopSignal
Signal for stopping a subscription.
SubscriptionSender
A bounded message sender supplied to a running subscription.

Enums§

FileEvent
What a FileWatcher observed 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.