1 | <?php |
||
5 | class SchedulerWorker |
||
6 | { |
||
7 | |||
8 | const DEFAULT_THROTTLE = 100; |
||
9 | |||
10 | private $implementation; |
||
11 | |||
12 | 2 | public function __construct(Implementation $implementation) |
|
16 | |||
17 | /** |
||
18 | * @param int|null $limit The maximum number of scheduled commands to queue. |
||
19 | * @param int $throttle The maximum number of scheduled commands to receive at a time. |
||
20 | * @param int|null $time The maximum amount of time in seconds to work. |
||
21 | * @param int $uSleepTime The number of microseconds to usleep between each query to the scheduler. |
||
22 | * @param \DateInterval|null $expiry The expiry interval for an overdue unqueued command. |
||
23 | */ |
||
24 | 1 | public function work( |
|
46 | |||
47 | 1 | private function iterate(int $throttle, \DateInterval $expiry = null): int |
|
65 | |||
66 | 1 | private function handleReceivedCommand(ReceivedScheduledCommand $command) |
|
76 | } |
||
77 |