richardartoul / nola

MIT License
74 stars 6 forks source link

Implement Reminders #12

Open richardartoul opened 1 year ago

richardartoul commented 1 year ago

As described in: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/Orleans-MSR-TR-2014-41.pdf

A reminder is a timer that fires whether or not the
actor is active. Thus, it transcends the actor activation
that created it, and continues to operate until explicitly
deleted. If a reminder fires when its actor is not activated,
a new activation is automatically created to process the
reminder message, just like any other message sent to
that actor. Reminders are reliable persistent timers that
produce messages for actors that created them while
allowing the runtime to reclaim system resources by
deactivating those actors, if necessary, in between
reminder ticks. Reminders follow the conceptual model
of virtual actors that eternally exist in the system and are
activated in memory only as needed to process incoming
requests. Reminders are a useful facility to execute
infrequent periodic work despite failures and without the
need to pin an actor’s activation in memory forever.
richardartoul commented 1 year ago

TODO: Need to figure out what interface we want for this + how to design it. I dont have clear thoughts on interface right now, but in terms of implementation we can probably track the reminders in the Registry and then use leader election to pick one of the server as being responsible for checking for upcoming Reminders and then running them (using InvokeActor).