Icicle\Concurrent\Worker\Worker::isRunning PHP Method

isRunning() public method

Checks if the worker is running.
public isRunning ( ) : boolean
return boolean True if the worker is running, otherwise false.
    public function isRunning() : bool;

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function close()
 {
     if ($this->open && $this->worker->isRunning()) {
         $coroutine = new Coroutine($this->worker->enqueue(new Internal\FileTask('fclose', [], $this->id)));
         $coroutine->done(null, [$this->worker, 'kill']);
     }
     if (!$this->queue->isEmpty()) {
         $exception = new FileException('The file was closed.');
         do {
             $this->queue->shift()->cancel($exception);
         } while (!$this->queue->isEmpty());
     }
     $this->open = false;
     $this->writable = false;
 }
All Usage Examples Of Icicle\Concurrent\Worker\Worker::isRunning