Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for actor reminders #716

Open
sebastianburckhardt opened this issue Apr 18, 2019 · 8 comments

Comments

@sebastianburckhardt
Copy link
Collaborator

commented Apr 18, 2019

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);
@cgillum

This comment has been minimized.

Copy link
Collaborator

commented Apr 18, 2019

Agreed, this would be good to have.

@olitomlinson

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2019

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!

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-actors-timers-reminders

@sebastianburckhardt sebastianburckhardt self-assigned this Apr 24, 2019
@sebastianburckhardt

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 26, 2019

(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 scheduleAtUtc argument to all the SignalEntity functions:

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.

@cgillum

This comment has been minimized.

Copy link
Collaborator

commented Sep 17, 2019

@sebastianburckhardt The underlying blockers have been resolved for this work item. Do you think you can resume working on it and have it in for beta3? I have a use case for it that I'd like to try out. :)

@sebastianburckhardt

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 17, 2019

Yes, I have already resumed work on this. Currently in the debugging stage... some things are still not quite working as expected inside DTFx, when combining timers and ContinueAsNew.

@jeffhollan

This comment has been minimized.

Copy link
Member

commented Sep 19, 2019

Very excited about this feature - great to hear it's unblocked 🤞

@sebastianburckhardt

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 20, 2019

I fixed one problem, but then hit another DTFx issue where timers cause duplicate activations of entities: Azure/durabletask#318. We'll have to fix that first.

@cgillum cgillum added the dtfx label Sep 25, 2019
@cgillum cgillum modified the milestones: v2.0.0-beta3, v2.0.0 Release Oct 2, 2019
@tomkuijsten

This comment has been minimized.

Copy link

commented Oct 3, 2019

Would love to test this feature. @sebastianburckhardt will there also be an option to cancel / postpone the timer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.