Deployer\Executor\Informer::startTask PHP 메소드

startTask() 공개 메소드

public startTask ( string $taskName )
$taskName string
    public function startTask($taskName)
    {
        if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
            $this->output->writeln("➤ Executing task <info>{$taskName}</info>");
            $this->output->setWasWritten(false);
            $this->startTime = round(microtime(true) * 1000);
        }
    }

Usage Example

예제 #1
0
 /**
  * Action time for master! Send tasks `to-do` for workers and go to sleep.
  * Also decide when to stop server/loop.
  */
 public function sendTasks()
 {
     if (!$this->wait) {
         if (count($this->tasks) > 0) {
             // Get task name to do.
             $task = current($this->tasks);
             $taskName = $task->getName();
             array_shift($this->tasks);
             $this->informer->startTask($taskName);
             if ($task->isOnce()) {
                 $task->run(new Context($this->localhost, $this->localEnv, $this->input, $this->output));
                 $this->informer->endTask();
             } else {
                 $this->tasksToDo = [];
                 foreach ($this->servers as $serverName => $server) {
                     if ($task->isOnServer($serverName)) {
                         if (!isset($this->environments[$serverName])) {
                             $this->environments[$serverName] = new Environment();
                         }
                         // Start task on $serverName.
                         $this->tasksToDo[$serverName] = $taskName;
                     }
                 }
                 // Inform all workers what tasks they need to do.
                 $taskToDoStorage = new ArrayStorage();
                 $taskToDoStorage->push($this->tasksToDo);
                 $this->pure->setStorage('tasks_to_do', $taskToDoStorage);
                 $this->wait = true;
             }
         } else {
             $this->loop->stop();
         }
     }
 }
All Usage Examples Of Deployer\Executor\Informer::startTask