Worker::collect PHP Method

collect() public method

Collects finished objects
public collect ( callable $function ) : void
$function callable
return void
    public function collect(callable $function)
    {
    }

Usage Example

コード例 #1
0
 public function testWorkerGc()
 {
     $worker = new Worker();
     $work = new WorkerTestWork();
     $worker->start();
     $worker->stack($work);
     $worker->shutdown();
     $this->assertEquals(1, $worker->collect(function ($task) {
         return false;
     }));
     $this->assertEquals(0, $worker->collect(function ($task) {
         return $task->isGarbage();
     }));
 }
All Usage Examples Of Worker::collect