コード例 #1
0
ファイル: BufferedStream.php プロジェクト: domraider/rxnet
 /**
  * @param string $data
  * @return Observable
  */
 public function write($data)
 {
     $buffer = new Buffer($this->socket, $this->loop, $data);
     // Write error close the stream
     $buffer->subscribeCallback(null, [$this, "close"], null, new EventLoopScheduler($this->loop));
     return $buffer;
 }
コード例 #2
0
ファイル: Stream.php プロジェクト: domraider/rxnet
 /**
  * @param string $data
  * @return Observable
  */
 public function write($data)
 {
     $buffer = new Buffer($this->socket, $this->loop, $data);
     // Write error close the stream, write completed wait for data
     $buffer->subscribeCallback(null, [$this, "close"], function () {
         $this->loop->addReadStream($this->socket, array($this, 'read'));
     });
     return $buffer;
 }