Title: Async Background Worker
Author: todiadiyatmo
Published: <strong>22 de Decembro, 2017</strong>
Last modified: 27 de Decembro, 2017

---

Buscar plugins

Este plugin **non se actualizou en máis de 2 anos**. É posible que xa non sexa compatible
ou mantido por ninguén, ou podes ter problemas de compatibilidade cando se usa con
novas versións de WordPress.

![](https://s.w.org/plugins/geopattern-icon/async-background-worker.svg)

# Async Background Worker

 Por [todiadiyatmo](https://profiles.wordpress.org/todiadiatmo/)

[Descargar](https://downloads.wordpress.org/plugin/async-background-worker.zip)

 * [Detalles](https://gl.wordpress.org/plugins/async-background-worker/#description)
 * [Valoracións](https://gl.wordpress.org/plugins/async-background-worker/#reviews)
 * [Desenvolvemento](https://gl.wordpress.org/plugins/async-background-worker/#developers)

 [Soporte](https://wordpress.org/support/plugin/async-background-worker/)

## Descrición

Async Background Worker, more information please visit this page [https://tonjoo.github.io/async-background-worker/](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/](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
 2.     ```
        $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);
        ```
    
 3. Implement function
 4.     ```
        function function_to_execute_on_background($data) {
            //do something usefull
            echo "Background job executed successfully\n";
        }
        ```
    
 5. 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.

## Comentarios

Non hai recensións para este plugin.

## Colaboradores e desenvolvedores

“Async Background Worker” é un software de código aberto. As seguintes persoas colaboraron
con este plugin.

Colaboradores

 *   [ todiadiyatmo ](https://profiles.wordpress.org/todiadiatmo/)
 *   [ Gama Priambada ](https://profiles.wordpress.org/gamaup/)

[Traduce “Async Background Worker” ao teu idioma.](https://translate.wordpress.org/projects/wp-plugins/async-background-worker)

### Interesado no desenvolvemento?

[Revisa o código](https://plugins.trac.wordpress.org/browser/async-background-worker/),
bota unha ollada ao[repositorio SVN](https://plugins.svn.wordpress.org/async-background-worker/),
ou subscríbete ao [log de desenvolvemento](https://plugins.trac.wordpress.org/log/async-background-worker/)
por [RSS](https://plugins.trac.wordpress.org/log/async-background-worker/?limit=100&mode=stop_on_copy&format=rss).

## Rexistro de cambios

#### 1.0.0

 * Initial Release

## Meta

 *  Versión **1.0**
 *  Última actualización **Fai 9 anos**
 *  Instalacións activas **10+**
 *  Versión de WordPress ** 4.4 ou superior **
 *  Probado ata **4.9.30**
 *  Idioma
 * [English (US)](https://wordpress.org/plugins/async-background-worker/)
 *  [Vista avanzada](https://gl.wordpress.org/plugins/async-background-worker/advanced/)

## Valoracións

Aínda non se enviaron valoracións.

[Your review](https://wordpress.org/support/plugin/async-background-worker/reviews/#new-post)

[Ver todas as valoracións](https://wordpress.org/support/plugin/async-background-worker/reviews/)

## Colaboradores

 *   [ todiadiyatmo ](https://profiles.wordpress.org/todiadiatmo/)
 *   [ Gama Priambada ](https://profiles.wordpress.org/gamaup/)

## Soporte

Tes algo que dicir? Necesitas axuda?

 [Ver o foro de soporte](https://wordpress.org/support/plugin/async-background-worker/)