Changeset 1791039
- Timestamp:
- 12/22/2017 04:14:54 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
r1791038 r1791039 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 [ WordPress](https://tonjoo.github.io/async-background-worker/ "Your favorite software")11 Async Background Worker, more information please visit this page [https://tonjoo.github.io/async-background-worker/](https://tonjoo.github.io/async-background-worker/ "Documentation") 12 12 13 13 == Sample Usage == … … 25 25 26 26 1. Add new job to new worker queue using `add_async_job` command 27 ` ``php27 ` 28 28 $job = new stdClass(); 29 29 // the function to run … … 33 33 34 34 add_async_job($job); 35 ` ``35 ` 36 36 2. Implement function 37 ` ``php37 ` 38 38 function function_to_execute_on_background($data) { 39 39 //do something usefull 40 40 echo "Background job executed successfully\n"; 41 41 } 42 ` ``42 ` 43 43 3. Run `wp background-worker listen` 44 44 45 45 == Command == 46 46 47 = `wp background-worker` = 48 47 `wp background-worker` 49 48 Run Async Background Worker once. 50 49 51 = `wp background-worker listen` = 50 `wp background-worker listen` 52 51 Run Async Background Worker in loop (contiously), this is what you want for background worker. WordPress framework is restart in each loop. 53 52 54 = `wp background-worker listen-daemon` = 53 `wp background-worker listen-daemon` 55 54 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. 56 55 57 56 == Changelog == 58 59 57 = 1.0.0 = 60 58 * Initial Release
Note: See TracChangeset
for help on using the changeset viewer.