Sleep - option to reset if called again

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
Moebius
Posts: 6
Joined: 06 Jan 2014 06:24

Sleep - option to reset if called again

Post by Moebius » 17 Jan 2014 09:18

Currently the sleep action does not restart if it is currently waiting and called again.

I would request a checkbox, where i can choose, if the timer should restart if activated.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Sleep - option to reset if called again

Post by Martin » 17 Jan 2014 12:32

Hi,

Action Sleep: 5s should wait for 5 seconds before the next action is executed. When you execute a flow twice, each sleep action should wait for the 5 seconds without affecting the other sleep action that's currently running.
Could you describe in more detail what kind of flow you would like to build, perhaps there's another way to achieve the desired behaviour.

Regards,
Martin

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Sleep - option to reset if called again

Post by MURTUMA » 17 Jan 2014 13:16

I think I understood this.

Execute flow with sleep action(30s) -> execute it again before the first sleep action has ended -> the flow continues forward two times, one time after each sleep action without stopping the first run.

Sometimes thats causing undesirable behavior especially when using variables, as it messes then up depending on how the flow is built. It can be "fixed" by putting a stop flow action at the start, but I think it would be better to have that option straight in the sleep action.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Sleep - option to reset if called again

Post by Martin » 17 Jan 2014 15:59

I think this does not belong to the sleep action since this could be a problem with every action when you don't want to execute the same flow multiple times in parallel.
I have some raw ideas on my todo-list to avoid such issues but it's not ready to be implemented yet (something like general options for a flow to skip, delay, cancel, limit and coalesce executions).

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Sleep - option to reset if called again

Post by MURTUMA » 17 Jan 2014 17:28

Maybe check box options to triggers to disable the flow while it's running and to stop the flow if it triggers while it's running?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Sleep - option to reset if called again

Post by Martin » 17 Jan 2014 18:09

Yes, something like that but in the flow instead of the trigger(s) since it's usually the design of the flow that makes parallel execution undesirable. Moreover one trigger could be used in different flows where one flow should only be executed once at a time and another flow should be executed for every event, even when this means that the flow is executed in parallel.

I had something like this in mind (very rough idea):
-a new menu item in the flow editing activity called "Options..."
-this opens a new screen with a dropdown containing items "Skip", "Delay", "Stop", "Limit", "Coalesce", ...

-Skip: don't execute the flow when it's already running (-->completely ignores the trigger event)
-Delay: wait until the executing flow terminates (probably with a timeout)
-Stop: stop the executing flow and execute the flow from start again
-Limit: only execute the flow when the flow did not exceed some kind of limit like 3 times in 5 minutes otherwise skip
-Coalesce: wait to execute the flow until no new trigger event arrives within a given duration

...but I have to think this over since it could also lead to a lot of problems like flows stalling each other and stuff like that.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Sleep - option to reset if called again

Post by MURTUMA » 17 Jan 2014 21:31

Sounds good. If it could be done per flow basis, it wouldn't affect other flows.

Locked