Optional interface for models that declare long-running subscriptions. More...
Public Member Functions | |
| IReadOnlyList<(string Key, ISub Sub)> | Subscriptions () |
| Return the set of subscriptions that should be active given the current model state. | |
Optional interface for models that declare long-running subscriptions.
Implement alongside IModel to participate in subscription management.
After every Update call the framework invokes Subscriptions and compares the returned set (by subscription key) with the currently running set. New subscriptions are started; subscriptions whose key is no longer present are cancelled.
Return the set of subscriptions that should be active given the current model state.
Each entry is a (key, sub) pair. The key uniquely identifies the subscription — use a stable string (e.g. a feature flag name or device id) so the framework can detect start/stop transitions.