Kraken\Loop\Model\SelectLoop::waitForStreamActivity PHP Method

waitForStreamActivity() private method

Wait/check for stream activity, or until the next timer is due.
private waitForStreamActivity ( float $timeout )
$timeout float
    private function waitForStreamActivity($timeout)
    {
        $read = $this->readStreams;
        $write = $this->writeStreams;
        if ($this->streamSelect($read, $write, $timeout) === false) {
            return;
        }
        foreach ($read as $stream) {
            $key = (int) $stream;
            if (isset($this->readListeners[$key])) {
                $callable = $this->readListeners[$key];
                $callable($stream, $this);
            }
        }
        foreach ($write as $stream) {
            $key = (int) $stream;
            if (isset($this->writeListeners[$key])) {
                $callable = $this->writeListeners[$key];
                $callable($stream, $this);
            }
        }
    }