This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
readme.txt
81 lines (61 loc) · 2.38 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
=== Pods Jobs Queue ===
Contributors: sc0ttkclark
Donate link: https://friends.pods.io/
Tags: pods, queued jobs, cronjobs
Requires at least: 4.9
Tested up to: 5.7
Stable tag: 0.1.7
Requires PHP: 5.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
**Requires PHP 5.6+, WordPress 4.9+, and Pods Framework 2.7+**
Queue callbacks to be ran with arguments, unlike wp_cron which is scheduled jobs, these are queued and run concurrently as needed.
== Usage ==
You can queue jobs to be run by calling:
`pods_queue_job( $data );`
Set your `$data` to an array of information that the job will use when it runs:
`
$data = [
/*
* The function to callback when running the job.
*
* Don't pass things like [ $this, 'some_method' ], use a string like: 'SomeClass::some_method' instead.
*/
'callback' => 'your_function',
/*
* Whatever data you want to pass to the job to run. This is optional but you can set it to an array of data to pass through.
*
* If this is provided as an array, the job will be run using: call_user_func_array( $callback, $args ).
*
* If this is empty, the job will be run using: call_user_func( $callback ).
*
* It will be serialized if necessary.
*/
'arguments' => [
'argument1' => 'Some value',
],
/*
* The blog ID the job should run on (for multisite support). This defaults to the current blog ID or 0.
*/
'blog_id' => 1234,
/*
* Specify a group for your job so you can categorize it if you've got lots of different jobs doing different segments of things.
*/
'group' => 'my-job-group',
/*
* Override the current status, this is will default to 'queued' so you never really have to set this.
*/
'status' => 'queued',
];
`
== Installation ==
1. Unpack the entire contents of this plugin zip file into your `wp-content/plugins/` folder locally
1. Upload to your site
1. Navigate to `wp-admin/plugins.php` on your site (your WP Admin plugin page)
1. Activate this plugin
OR you can just install it with WordPress by going to Plugins >> Add New >> and type this plugin's name
== Contributors ==
Check out our GitHub for a list of contributors, or search our GitHub issues to see everyone involved in adding features, fixing bugs, or reporting issues/testing.
[github.com/pods-framework/pods-jobs-queue/graphs/contributors](https://github.com/pods-framework/pods-jobs-queue/graphs/contributors)
== Changelog ==
N/A