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

Consider/research: activity execution options #31

Open
toggledbits opened this issue Apr 10, 2019 · 0 comments
Open

Consider/research: activity execution options #31

toggledbits opened this issue Apr 10, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@toggledbits
Copy link
Owner

toggledbits commented Apr 10, 2019

I am considering introducing the following options for running scenes and activities within Reactor. Before diving in, a bit of background: currently, Reactor runs activities as fast as Vera will take them. If an action uses the 'run' tag exclusively, it is run "in line," meaning Reactor (or really Luup) waits for the action to complete before moving on to the next step. If the action uses a 'job', however, Luup submits the job to its job queue and runs it later (Luup's scheduling algorithm is not documented, but appears to be FIFO). If an activity contains a delay, the delayed actions are detached to a separate task in Reactor, and Reactor immediately moves on to other business. The delayed actions are then run at the scheduled time with the same heuristic as above. By example, if a Reactor sensor has three eligible group activities, they will run sequentially at the end of condition evaluation.

Now then, the options:

  1. Detach -- the entire activity would be run as a Luup job. This would not change Luup's scheduling of the actions within (run vs job, etc.), but it would affect Reactor's performance in getting to its next evaluation or starting its next group activity: this would reduce the time required by Reactor to start group activities. Using the above example, if the first of the three eligible group activities is long-running, and the second is time-critical, the second will, currently, always be delayed by the first, perhaps to its detriment. By being able to "detach" the first group activity, the second group would be able to execute almost immediately, and the actions of the first group will run as soon as the Vera/Luup scheduler allows.
  2. Serial -- If an activity contains an action that Luup runs as a job, Reactor would wait for the job to complete. If within an activity, the successful completion of a later step is dependent on an earlier step, and the earlier step runs as a job, the job may not run at all prior to the later step being run. By turning on the "serial" option, Reactor would see that the action was queued as a job and wait until the job completes. Additional options would allow a timeout (Reactor would continue the activity if the timeout was met before the job signalled an exit status), and continue-on-error, by which the user could specify if the remaining actions in the activity should execute if a job fails.
@toggledbits toggledbits self-assigned this Apr 10, 2019
@toggledbits toggledbits added the enhancement New feature or request label Apr 10, 2019
@toggledbits toggledbits changed the title Consider/research: scene run action options Consider/research: activity execution options Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant