nitric icon indicating copy to clipboard operation
nitric copied to clipboard

Support dynamic events or schedules

Open asalkeld opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. When creating the scrumpolice bot, it was very frustrating to only have fixed schedules. I wanted to support:

  • reporting each team standup report on a configurable time
  • reminding each team member that they need to do their report

The only way to do this on a fixed schedule is to "poll" on shorter freqencies and check - this is more expensive as there is unnecessary function runtime.

Describe the solution you'd like I'd like to be able to ask for callbacks on customizable times (with repeats).

Describe alternatives you've considered These could be delayed messages or schedules.

asalkeld avatar Mar 21 '22 02:03 asalkeld

aws: https://github.com/alestic/aws-sns-delayed azure: https://medium.com/event-driven-utopia/azure-service-bus-essentials-scheduled-messages-98fd542f9d55 gcp: https://cloud.google.com/tasks/docs/dual-overview

asalkeld avatar Mar 21 '22 06:03 asalkeld

@asalkeld Looking at how this functionality could be shimmed into our existing eventing plugins: image

tjholm avatar Sep 05 '22 01:09 tjholm

Just a thought.

If using something like Cloud Tasks, the ID of the task should be configurable. (Unsure if this is possible with Step Functions/Logic Apps).

This way one can also easily delete a pending task if desired.

Otherwise, worst case would be that the function for creating a task should return the ID of it so that it can be saved to be able to reference it or delete it later.

Ataraxy avatar Oct 10 '22 15:10 Ataraxy

@Ataraxy thanks for the feedback. We could definetely do this by re-using the provided message ID that can be set on existing events (this is autogenerated if not provided), and is already returned in our existing Publish as well.

The initial implementation for delayed messages is in for review and doesn't include cancellation of pending events. But will raise a new issue/discussion for this.

tjholm avatar Oct 11 '22 00:10 tjholm