| 1 |
<?php |
| 2 |
/** |
| 3 |
* Batch Task Interface |
| 4 |
* |
| 5 |
* @since 4.0.0 |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace wpCloud\StatelessMedia\Batch; |
| 9 |
|
| 10 |
interface IBatchTask { |
| 11 |
|
| 12 |
/** |
| 13 |
* Initialize the state of the task |
| 14 |
*/ |
| 15 |
public function init_state(); |
| 16 |
|
| 17 |
/** |
| 18 |
* Get human-friendly description |
| 19 |
*/ |
| 20 |
public function get_description(); |
| 21 |
|
| 22 |
/** |
| 23 |
* Get the current state of the task |
| 24 |
*/ |
| 25 |
public function get_state(); |
| 26 |
|
| 27 |
/** |
| 28 |
* Set/restore the current state of the task |
| 29 |
*/ |
| 30 |
public function set_state($state); |
| 31 |
|
| 32 |
/** |
| 33 |
* Get the next batch of items to process |
| 34 |
*/ |
| 35 |
public function get_batch(); |
| 36 |
|
| 37 |
/** |
| 38 |
* Process the item |
| 39 |
*/ |
| 40 |
public function process_item($item); |
| 41 |
} |
| 42 |
|