Async Background Worker

Async Background Worker

from 0$

Async Background Worker is a Package Installer from the Open Source WP Plugins range Async Background Worker, more information please visit this page [https://tonjoo.github.io/async-background-worker/](https://tonjoo.github.

For more information about a tailored Package Installer like Async Background Worker please contact us directly.

Async Background Worker, more information please visit this page https://tonjoo.github.io/async-background-worker/

Sample Usage

What is it ?

WordPress background worker plugin that enable WordPress to interact with beanstalkd work queue.

Why we need a worker ?

We can run a very long task in the background, for example we need to import 100.000 row into WordPress databases. Instead of doing the 100.000 import in one job, we can separate the job into many smaller job which is safer.

WP-CLI

Make sure you have WP CLI installed on your system

Support Forum

https://forum.tonjoostudio.com/thread-category/async-background-worker/

Add job to queue

  1. Add new job to new worker queue using add_async_job command

    $job = new stdClass();  
    // the function to run  
    $job->function = 'function_to_execute_on_background';  
    // our user entered data  
    $job->user_data = array('data'=>'some_data');
    add_async_job($job);
    
  2. Implement function

    function function_to_execute_on_background($data) {
        //do something usefull
        echo "Background job executed successfullyn";
    }
    
  3. Run wp background-worker listen

Command

  • wp background-worker
    Run Async Background Worker once.

  • wp background-worker listen
    Run Async Background Worker in loop (contiously), this is what you want for background worker. WordPress framework is restart in each loop.

  • wp background-worker listen-daemon
    Run Async Background Worker in loop (contiously) without restart the WordPress framework. NOTE if you use this mode, any code change will not be reflected. You must restart the Async Background Worker each time you change code. This save memory and speed up thing.

Download & install the zip archive

The plugin package installer can be downloaded from the WP2E project tab called “code”.

1 – Select the version to download if this option is available otherwise the “latest” version of the main plugin will be used.

2 – After downloading the zip archive install the plugin package installer in you local environment and activate the script from the plugin list.

3 – Under the section “Plugins” of the admin dashboard you should see a new “Dependencies & Licenses” link. Follow the instructions from this panel to finalize the installation of the missing dependencies.

Tips: Use the WP2E panel to add/suggest new dependencies to the local installation. Press F5 in the list of dependencies if the changes are not displayed right away.

Async Background Worker

typePlugin
versionlatest
descriptionAsync Background Worker, more information please visit this page [https://tonjoo.github.io/async-background-worker/](https://tonjoo.github.