Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide once trigger #89

Closed
csantanapr opened this issue Sep 1, 2017 · 7 comments
Closed

Provide once trigger #89

csantanapr opened this issue Sep 1, 2017 · 7 comments

Comments

@csantanapr
Copy link
Member

Feature request:

A user would like for a trigger to be fire once at a specific time and date, and optionally delete the trigger after the fire.

One idea for UX could be: (at is UTC based)

wsk trigger create onshot --feed /whisk.system/alarm/once --param at `December 24, 2017 23:30:00`

current stat is to set a cron trigger with maxTrigger of 1, which would cause a lot of problems in terms of cleaning up "dead" triggers and trying to guesstimate when is going to actual fire.

@rabbah
Copy link
Member

rabbah commented Sep 1, 2017

related to #86.

@sjfink
Copy link

sjfink commented Sep 1, 2017

could you elaborate: what are the ("lot of") problems with layering this on top of cron?

I would hope the cron implementation can handle this pattern without difficulty.

@starpit
Copy link

starpit commented Sep 2, 2017

i think carlos wants it to auto-destruct after firing. if done via rules, there is a race. it could be done with a sequence wrapper around the activated action, i suppose.

@csantanapr
Copy link
Member Author

Under the hood we the implementation will use 'new Cron(new Date(stringdate))'

The a lot problems was more on capturing the users point of view.

To some users it would be confusing trying to understand that we can "hack" cron to take a date string.

Also provides a cleaner API to ask the user what it wants to do with the trigger when done.

This is a building block for when we get to a point of the feed service create a rule for them and have a syntax like
'''
wsk action create foo --at $somefuturedate
'''
sugar to tell the system handle the triggers and rules (create them and clean them) for me just run this action once at $somefuturedate

@jthomas
Copy link
Member

jthomas commented Oct 19, 2017

👍 on this feature and an optional parameter to "delete after firing".

I can see lots of use-cases when an action wants to schedule a trigger to fire a set period after it is running using this approach.

@meyumeapps
Copy link

👍 this would be a very useful feature for me as currently I'm having to run clean up jobs looking for stale triggers and rules.

For my perspective it would be good to have an uber trigger that encapsulates the trigger and rule e.g. a Job.

It's the job which I can designate as runOnce and have the system clean up after it's finished.

@csantanapr
Copy link
Member Author

The first phase of trigger once is done.

I opened a new issues #123 to discuss the deletion of the trigger and rules after fire.

Closing for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants