/** * Reads a line from console, if available. Returns null if not available * * @return string|null */ public function getLine() { if ($this->buffer->count() !== 0) { return $this->buffer->shift(); } return null; }
/** * Reads a line from console, if available. Returns null if not available * * @return string|null */ public function getLine() { if ($this->buffer->count() !== 0) { return $this->buffer->synchronized(function () { return $this->buffer->shift(); }); } return \null; }
/** * @internal Only call from AsyncPool.php on the main thread * * @param Server $server */ public function checkProgressUpdates(Server $server) { while ($this->progressUpdates->count() !== 0) { $progress = $this->progressUpdates->shift(); $this->onProgressUpdate($server, unserialize($progress)); } }
public function testThreadedShift() { $threaded = new Threaded(); $threaded[] = "something"; $threaded[] = "else"; $this->assertEquals("something", $threaded->shift()); $this->assertEquals(1, count($threaded)); }
public function readThreadToMainPacket() { return $this->externalQueue->shift(); }