You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in this ticket it make sense to have Timer.Reset and Timer.Reschedule API available to library users. These API are quite generic and could be useful in many scenarios.
Suggested API
Case 1:publicclassOrderWorkflow: Workflow
{public OrderWorkflow(){
ScheduleTimer("GracePeriod").FireAfter(TimeSpan.FromMinutes(30));ScheduleActivity<ShipOrder>().AfterTimer("GracePeriod");}[WorkflowEvent(EventName.Signal)]public WorkflowAction Signal(WorkflowSignaledEvent@event){//This reschedule timer with by taking the timeout from FireAfter APIvartimer= Timer("GracePeriod");if(@event.SignalName =="change_time")if(timer.IsActive) timer.Reset();returnIgnore;}}
Case 2:publicclassOrderWorkflow: Workflow
{public OrderWorkflow(){
ScheduleTimer("GracePeriod").FireAfter(TimeSpan.FromMinutes(30));ScheduleActivity<ShipOrder>().AfterTimer("GracePeriod");}[WorkflowEvent(EventName.Signal)]public WorkflowAction Signal(WorkflowSignaledEvent@event){//This reschedule timer with given timeout.vartimer= Timer("GracePeriod");if(@event.SignalName =="change_time")if(timer.IsActive) timer.Reschedule(TimeSpan.FromMinutes(20)));returnIgnore;}}
The text was updated successfully, but these errors were encountered:
Any plans on releasing this change in the short term?
gurmitteotia
changed the title
Add support of rescheduling and resetting the already scheduled timer.
Add support for rescheduling and resetting the already scheduled timer.
Nov 13, 2018
I can take this up for next release. Anyway I'm going to focus on timers and signals in next few releases.
This ticket will also set the stage for next big ticket.
As discussed in this ticket it make sense to have Timer.Reset and Timer.Reschedule API available to library users. These API are quite generic and could be useful in many scenarios.
Suggested API
The text was updated successfully, but these errors were encountered: