Invoke action at certain time #307
Replies: 4 comments 1 reply
-
Use the task scheduler. For a specific date, you'll want to probably use the Use the typical cron format like Now, it depends where the payload is coming from. If these are dynamically / user generate payloads, then you might want to do something more like this:
|
Beta Was this translation helpful? Give feedback.
-
The cron expression I gave as an example would run every year. If you stored the expiration date as in the second suggestion, then the scheduler would run more often (every minute or second if you wanted), but the item in question wouldn't be removed until the expiration date is reached. |
Beta Was this translation helpful? Give feedback.
-
To be precise, I am looking for something like fire and forget, that could be var expirationTime = DateTime.UtcNow.AddDay(1); // or find it from db
var scheduleTime = expirationTime - DateTime.UtcNow;
queue.QueueAsyncTask(() => {
await Task.Delay(scheduleTime);
// remove the file
}); |
Beta Was this translation helpful? Give feedback.
-
Okay - this functionality doesn't exist yet. Would require persistent queued item which I'd like to rig up 👍 |
Beta Was this translation helpful? Give feedback.
-
I want to execute certain action at given time with payload. I don't know what is the best way to do this, either using queue or task scheduler. Example, remove blob file at path 'xxx' at 2020-09-05T20:05:10Z0. So the payload will be blob path.
Beta Was this translation helpful? Give feedback.
All reactions