setGarbage() public method

public setGarbage ( )
示例#1
0
 private function removeTask(AsyncTask $task, $force = false)
 {
     $task->setGarbage();
     if (isset($this->taskWorkers[$task->getTaskId()])) {
         if (!$force and ($task->isRunning() or !$task->isGarbage())) {
             return;
         }
         $this->workerUsage[$this->taskWorkers[$task->getTaskId()]]--;
     }
     unset($this->tasks[$task->getTaskId()]);
     unset($this->taskWorkers[$task->getTaskId()]);
     $task->cleanObject();
 }
示例#2
0
 public function collectAsyncTask(AsyncTask $task)
 {
     if ($task->isFinished() and !$task->isGarbage()) {
         --$this->asyncTasks;
         $task->onCompletion(Server::getInstance());
         $task->setGarbage();
         unset($this->asyncTaskStorage[$task->getTaskId()]);
     }
     return $task->isGarbage();
 }