Changeset 1791038
- Timestamp:
- 12/22/2017 04:10:39 AM (8 years ago)
- File:
-
- 1 edited
-
async-background-worker/trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
async-background-worker/trunk/readme.txt
r1791037 r1791038 1 1 === Async Background Worker === 2 Contributors: todi.adiyatmo, gamaup2 Contributors: Todi.Adiatmo, gamaup 3 3 Description: Async Background Worker for WordPress. 4 4 Tags: background worker, async background worker 5 5 Requires at least: 4.4 6 Tested up to: 4. 8.06 Tested up to: 4.9 7 7 Version: 1.0 8 8 License: LGPL 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html 10 10 11 Async Background Worker, more information please visit this page https://tonjoo.github.io/async-background-worker/11 Async Background Worker, more information please visit this page [WordPress](https://tonjoo.github.io/async-background-worker/ "Your favorite software") 12 12 13 13 == Sample Usage == 14 14 15 # What is it ? 15 = What is it ? = 16 16 WordPress background worker plugin that enable WordPress to interact with beanstalkd work queue. 17 17 18 # Why we need a worker ? 18 = Why we need a worker ? = 19 19 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. 20 20 21 # WP-CLI 21 = WP-CLI = 22 22 Make sure you have WP CLI installed on your system 23 23 24 ## Add job to queue 24 == Add job to queue == 25 25 26 26 1. Add new job to new worker queue using `add_async_job` command 27 ``` 27 ```php 28 28 $job = new stdClass(); 29 29 // the function to run … … 35 35 ``` 36 36 2. Implement function 37 ``` 37 ```php 38 38 function function_to_execute_on_background($data) { 39 39 //do something usefull … … 43 43 3. Run `wp background-worker listen` 44 44 45 ## Command 45 == Command == 46 46 47 ### `wp background-worker` 47 = `wp background-worker` = 48 48 49 49 Run Async Background Worker once. 50 50 51 ### `wp background-worker listen` 52 51 = `wp background-worker listen` = 53 52 Run Async Background Worker in loop (contiously), this is what you want for background worker. WordPress framework is restart in each loop. 54 53 54 = `wp background-worker listen-daemon` = 55 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. 55 56 56 ### `wp background-worker listen-daemon` 57 == Changelog == 57 58 58 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. 59 = 1.0.0 = 60 * Initial Release
Note: See TracChangeset
for help on using the changeset viewer.