restate icon indicating copy to clipboard operation
restate copied to clipboard

Repeated timers/Intervals

Open slinkydeveloper opened this issue 2 years ago • 2 comments

Our internal timers abstraction right now can only schedule timers, but not deschedule them, nor it supports intervals. By adding support for intervals we could:

  • Expose a cron scheduling functionality to the user, e.g. something like a built in service Cron#Create(service_to_invoke, interval)
  • Simplify implementing internal functionalities like the inactivity timeout in the RemoteContext: https://github.com/restatedev/restate/pull/840

slinkydeveloper avatar Oct 13 '23 12:10 slinkydeveloper

I'm a temporal user since long time ago. Restate seems interesting, Cron & Continue-as-new is critical for real cases.

Code2Life avatar Jul 03 '24 07:07 Code2Life

Thanks a lot for the feedback @Code2Life. Improving the scheduling primitives that Restate exposes is very important to improve the ergonomics and make use cases simpler to implement.

Regarding continue-as-new, Restate supports it natively since a virtual object is stateful and every invocation of a handler starts a new journal (event history). So by calling yourself, you would finish the current event history and start a new one but keep the state of the virtual object to propagate context if needed.

tillrohrmann avatar Jul 03 '24 08:07 tillrohrmann