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

Comments

Projects
None yet
6 participants
@csantanapr
Contributor

csantanapr commented Sep 1, 2017

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

This comment has been minimized.

Show comment
Hide comment
@rabbah

rabbah Sep 1, 2017

Member

related to #86.

Member

rabbah commented Sep 1, 2017

related to #86.

@sjfink

This comment has been minimized.

Show comment
Hide comment
@sjfink

sjfink 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.

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

This comment has been minimized.

Show comment
Hide comment
@starpit

starpit 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.

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

This comment has been minimized.

Show comment
Hide comment
@csantanapr

csantanapr Sep 2, 2017

Contributor

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

Contributor

csantanapr commented Sep 2, 2017

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

This comment has been minimized.

Show comment
Hide comment
@jthomas

jthomas Oct 19, 2017

Member

👍 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.

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

This comment has been minimized.

Show comment
Hide comment
@meyumeapps

meyumeapps Oct 19, 2017

👍 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.

meyumeapps commented Oct 19, 2017

👍 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

This comment has been minimized.

Show comment
Hide comment
@csantanapr

csantanapr Jan 21, 2018

Contributor

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

Contributor

csantanapr commented Jan 21, 2018

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

@csantanapr csantanapr closed this Jan 21, 2018

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