Rx\Scheduler\VirtualTimeScheduler::scheduleAbsoluteWithState PHP Method

scheduleAbsoluteWithState() public method

public scheduleAbsoluteWithState ( $state, $dueTime, callable $action )
$action callable
    public function scheduleAbsoluteWithState($state, $dueTime, callable $action)
    {
        $queue = $this->queue;
        $currentScheduler = $this;
        $scheduledItem = null;
        $run = function ($scheduler, $state1) use($action, &$scheduledItem, &$queue) {
            $queue->remove($scheduledItem);
            return $action($scheduler, $state1);
        };
        $scheduledItem = new ScheduledItem($this, $state, $run, $dueTime);
        $this->queue->enqueue($scheduledItem);
        return $scheduledItem->getDisposable();
    }

Usage Example

Example #1
0
 public function scheduleAbsoluteWithState($state, $dueTime, callable $action)
 {
     if ($dueTime <= $this->clock) {
         $dueTime = $this->clock + 1;
     }
     return parent::scheduleAbsoluteWithState($state, $dueTime, $action);
 }
All Usage Examples Of Rx\Scheduler\VirtualTimeScheduler::scheduleAbsoluteWithState