Describe the proposal
In DaprWorkflowContext the create_timer method is defined as follows:
def create_timer(self, fire_at: datetime) -> task.Task:
However, it would be more convenient to also support timedelta as a parameter type. Note that the undelrying Durable Task SDK already supports this:
def create_timer(self, fire_at: Union[datetime, timedelta]) -> Task:
The workaround is that developers must do the following:
ctx.create_timer(ctx.current_utc_datetime + SOME_TIME_DELTA)
This workaround is problematic because it can tempt users to violate code constraint rules if they accidentally use datetime.now(), which is non-deterministic, instead of ctx.current_utc_datetime.
Ideally, users could simply write the following:
ctx.create_timer(SOME_TIME_DELTA)