コード例 #1
0
 public function run()
 {
     while (true) {
         $message = MessageFactory::createFromInputLine($this->stream->readLine(), $this->checkpointer);
         $responds = $message->getRespond($this->processor);
         $this->stream->writeLine($responds->asString());
     }
 }
コード例 #2
0
 private function dispatchMessage(Output $message)
 {
     $this->stream->writeLine($message->asString());
     /** @var CheckpointError $message */
     $message = MessageFactory::createFromInputLine($this->stream->readLine(), $this);
     if ($message->error) {
         $this->stream->error('Error occurred then trying to checkpoint: ' . $message->error);
     }
 }
コード例 #3
0
 public function writeLine($line)
 {
     $this->stream->writeLine($line);
     file_put_contents($this->logFilePath, "OUT: " . $line . PHP_EOL, FILE_APPEND);
 }