| 1 | <?php  | 
            ||
| 7 | class TaskQueue implements TaskQueueInterface  | 
            ||
| 8 | { | 
            ||
| 9 | /**  | 
            ||
| 10 | * @var array  | 
            ||
| 11 | */  | 
            ||
| 12 | private $tasks = [];  | 
            ||
| 13 | |||
| 14 | /**  | 
            ||
| 15 | * Add callbacks or \Closure into task queueing stack.  | 
            ||
| 16 | *  | 
            ||
| 17 | * @param InvokerInterface $invoker  | 
            ||
| 18 | * @param array $taskArgs The callback or Closure arguments.  | 
            ||
| 19 | * @return TaskQueueInterface  | 
            ||
| 20 | */  | 
            ||
| 21 | public function add(InvokerInterface $invoker, $taskArgs = [])  | 
            ||
| 29 | |||
| 30 | /**  | 
            ||
| 31 | * Invoke all of pending task in the task queueing stack.  | 
            ||
| 32 | *  | 
            ||
| 33 | * @return void  | 
            ||
| 34 | */  | 
            ||
| 35 | public function run()  | 
            ||
| 41 | }  | 
            ||
| 42 |