Skip to content

Add complete method callback to array-based method of background processes #2

@alexstandiford

Description

@alexstandiford

Batch processes have a complete method, and it would be nice if it were possible to specify the callback for this using Underpin's array-based method. Something like this:

underpin()->background_processes()->add( 'example', [
	'action'               => 'example_action_name', // Action Name. Must be unique.
	'task_action_callback' => function ( $item ) {   // Callback to fire on a single item.
	  // Do an action
	},
        'complete_callback'     => function (){
          // Do an action on-complete
        }
] );

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions