mpyw\Co\Internal\Delayer::isEmpty PHP Method

isEmpty() public method

Is $untils empty?
public isEmpty ( ) : boolean
return boolean
    public function isEmpty()
    {
        return !$this->untils;
    }

Usage Example

Beispiel #1
0
Datei: Pool.php Projekt: mpyw/co
 /**
  * Run curl_multi_exec() loop.
  */
 public function wait()
 {
     curl_multi_exec($this->mh, $active);
     // Start requests.
     do {
         // if cURL handle is running, use curl_multi_select()
         // otherwise, just sleep until nearest time
         $this->scheduler->isEmpty() ? $this->delayer->sleep() : curl_multi_select($this->mh, $this->options['interval']) < 0 && usleep($this->options['interval'] * 1000000);
         curl_multi_exec($this->mh, $active);
         $this->scheduler->consume();
         $this->delayer->consume();
     } while (!$this->haltException && (!$this->scheduler->isEmpty() || !$this->delayer->isEmpty()));
     if ($this->haltException) {
         throw $this->haltException;
     }
 }