Skip to content

Files

Latest commit

 

History

History
51 lines (40 loc) · 1.84 KB

jobs-tasks-and-actions.md

File metadata and controls

51 lines (40 loc) · 1.84 KB

Jobs, Tasks and Actions

  • job - is abstract definition if task, one job consists one or more tasks.
  • action - is simple action step executed as part of job.
  • task - an instance of job submitted for execution. execution-queue

Task Execution

rpi-powercontroller is executing submitted jobs in serial manner and order. Submitted job is transformed into task with unique task-id and becomes part of job queue execution. All tasks are executed on single thread.

execution-states

  • WAITING - Task was created and is waiting for execution in queue.
  • IN_PROGRESS - Task is executed / running.
  • CANCELLED - Task was cancelled before is being executed.
  • ABORTED - Task was interrupted while executing / running.
  • FINISHED - Task finished successfuly.
  • FAILED - Task failed during it's execution.
  1. Job is submitted for execution, an instance of task is created with unique task-id.
  2. Task is cancelled without starting execution phase.
  3. Task is started.
  4. Running/executed task is cancelled.
  5. Task execution finished without exception or error.
  6. Task execution finished with error or execption occured.

Submit new Task

  • submit task by jobId - TBD
  • submit parametric task by jobId - TBD/WIP

List Task Queue

TBD

Cancel Submitted Task

TBD

Kill Them All

  • killAllTasksJobId - selected job may be triggered on killAllTasks event. This event stops currently executed task as well as all tasks waiting in the execution queue. Once all tasks are stopped or cancelled, an instance of killAllTasksJobId is executed in same thread.

Default Actions

  • action-port-high - turns ON selected port.
  • action-port-low - turns OFF selected port.
  • action-wait - waits idle for given time period.

Custom Actions

TBD/WIP