PHP code example of underpin / background-process-loader

1. Go to this page and download the library: Download underpin/background-process-loader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

underpin / background-process-loader example snippets


underpin()->async_requests()->add( 'key', [
	'action'               => 'key',        // Action Name. Must be unique.
	'task_action_callback' => function () { // Callback to fire
		// do things
	},
] );

underpin()->async_request()->add('key','Namespace\To\Class');

underpin()->async_requests()->dispatch( 'key' );

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
	},
] );

underpin()->background_processes()->add('key','Namespace\To\Class');

underpin()->background_processes()->enqueue( 'key', ['args' => 'to pass to task_action_callback'] );

underpin()->background_processes()->dispatch( 'key' );