Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for actor reminders #716
When writing samples it became clear that there are situations where an actor wants to send itself a message with a time delay.
I believe we should support this, perhaps by adding a method along the lines of
ctx.ScheduleOperation(TimeSpan delay, string operationName, object operationContent);
This is a very desirable feature of an Actor!
While your in the design phase, it might be worth checking out Service Fabric Actor Timers & Reminders for some inspiration!
(BTW, based on feedback we renamed actor to entity - just a new name, same thing.)
After going through a few designs my plan is to support as a more general feature which allows an optional
ctx.SignalEntity(entityId, operationName, operationInput, scheduleAtUtc);
Then a "reminder" requirement can be implemented by having an entity send a signal to itself, scheduled for some time in the future, e.g.:
ctx.SignalEntity(ctx.Self, operationName, operationInput, DateTime.UtcNow + TimeSpan.FromSeconds(30));
I ran into a gating issue Azure/durabletask#285 so I'll probably delay work on this for a while.