| 1 | <?php |
||
| 11 | class RoundRobin extends SplHeap implements ScheduleInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var callable The comparator to use to determine the order |
||
| 15 | */ |
||
| 16 | protected $callback; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Initialize the priority schedule |
||
| 20 | */ |
||
| 21 | public function __construct() |
||
| 32 | |||
| 33 | /** |
||
| 34 | * {@inheritdoc} |
||
| 35 | * |
||
| 36 | * $callback Should accept a two parameters and return an int |
||
| 37 | * (0 if items are equal, 1 to put left on top, -1 to put right on top) |
||
| 38 | */ |
||
| 39 | public function setCallback(callable $callback) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * {@inheritdoc} |
||
| 46 | */ |
||
| 47 | public function compare($value1, $value2) |
||
| 51 | |||
| 52 | /** |
||
| 53 | * {@inheritdoc} |
||
| 54 | */ |
||
| 55 | public function extract() |
||
| 65 | } |
||
| 66 |