Nirbhay Jha
Nirbhay Jha

Reputation: 675

Cancel scheduled operation for azure function durable entities

Is it possible to cancel a scheduled operation in azure function durable entity ? Below is an example code.I want to cancel the call to operation "DeviceTimeout"after it is scheduled.

Entity.Current.SignalEntity(Entity.Current.EntityId, DateTime.UtcNow.Add(TimeSpan.FromSeconds(30)), nameof(DeviceTimeout));

Upvotes: 0

Views: 429

Answers (1)

Peter Bons
Peter Bons

Reputation: 29780

Unfortunately not. There is an open issue requesting this ability but afaik it has not been implemented yet:

I can' think of a very straightforward API to provide this. One approach would be to include some sort of unique identifier for the signal so that a cancellation request can be precisely matched to the signal being cancelled. But there are some open questions on what exactly the implementation would have to guarantee, and whether that can lead to new issues. For example, would we need to store a cancellation request that we can't match to a signal until such a signal arrives? what if it never arrives?

I suppose the next best thing is to just exit immediately once the operation is executed.

Upvotes: 1

Related Questions