-
Notifications
You must be signed in to change notification settings - Fork 20
Description
What's needed?
We want a mechanism to announce future activity so actors executing dispatches (or wanting to announce future activity for any other reasons) can broadcast this information, and actors wanting to use this information to make decisions can subscribe to the announcements.
For example, if some actor know that it will need to discharge a battery with X power at some point in time, it can send an announcement about this so other actors can plan and maybe avoid using that battery at that time (or whatever action makes more sense).
This is somewhat similar to dispatching but dispatches are requests, and just because they are broadcasted doesn't mean they will be executed. Actors should not make decisions based on which dispatches are being broadcasted, only
Proposed solution
Probably it should be enough for the SDK to just provide a BroadcastChannel of some FutureActivityAnnouncement objects. This channel should be created when the SDK is initialized.
Users should be able to create new senders (to announce future activity) and receivers (to subscribe to announcements) for this channel.
Actors executing dispatches should announce the future activity.
Use cases
No response
Alternatives and workarounds
- Use ad-hoc communication between actors.
Additional context
At some point we need to provide a way to notify that some future activity announcement was cancelled, as actors making those announcements might decide not to do what they announced after all if some condition changed.
One way to do this could be for every announcement to have a UUID and to have a special cancellation message referencing that UUID, another way might be to set the announcement value (power or whatever) to zero and identify the announcement using a combination of announcement properties (for example actor name and time of the future activity).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status