The run_once flag is used for interactive tasks to omit them from being executed by the orchestrator repeatedly.

For non-interactive tasks, we've generally set a flag within the queue to detect whether the execution of the task should be skipped.

Introduce a new API to get and set the Maestro suspension flag.
There needs to be a few new APIs:

getSuspensionFlag($queueID)
setSuspensionFlag($queueID, $suspension_flag = MAESTRO_SUSPEND)

and the base constants:

// Maestro suspension flags
const MAESTRO_UNSUSPENDED = 0;
const MAESTRO_SUSPEND = 1;
const MAESTRO_ALLOW_SUSPENDED_COMPLETION = 2;

Comments

_randy created an issue. See original summary.

  • _randy committed 621899d4 on 4.x
    feat: #3560150 New APIs to get and set a Maestro suspension flag
    
    By:...

  • _randy committed a20b59ad on 4.x
    feat: #3560150 New APIs to get and set a Maestro suspension flag
    
    By:...
_randy’s picture

Status: Active » Fixed

Added the new APIs and the Maestro module's constants.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • _randy committed de9ac138 on 4.x
    feat: #3560150 New APIs to get and set a Maestro suspension flag
    
    By:...
_randy’s picture

Status: Fixed » Active
_randy’s picture

We can augment the engine to eliminate the need for individual tasks to worry about suspension execution, however, tasks which are suspended and are resumed will re-execute.

But forcing the engine to look at the dynamic suspension flag we can determine whether to allow execution of the task or not.

If a task, regardless of type, has been set to MAESTRO_SUSPEND we skip execution in the engine altogether.

When a task is set to anything other than MAESTRO_SUSPEND we can execute the task.
It will be up to the task implementation to detect whether or not to re-run the entire execute() method's logic once unsuspended.

  • _randy committed 4ad40e80 on 4.x
    feat: #3560150 New APIs to get and set a Maestro suspension flag
    
    By:...
_randy’s picture

Status: Active » Fixed

The following APIs have been added:

getQueueItemTaskData
setQueueItemTaskData
setSuspensionFlag
getSuspensionFlag

A suspended task which uses the SetSuspensionFlag API will have its task status appear as "On hold" and the suspension flag in the task_data set.

The separation of task status AND suspension flag in the task_data allows for developers to suspend tasks in an absolute fashion (as done with the API) or suspend the task manually and still allow for processing based on the MAESTRO_ALLOW_SUSPENDED_COMPLETION suspension flag.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • _randy committed abe89ba9 on 4.x
    feat: #3560150 New APIs to get and set a Maestro suspension flag
    
    By:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.