createFromStream() public static method

Optional method to set the internal stream handle
public static createFromStream ( $stream ) : Socket
$stream
return Socket
Exemplo n.º 1
0
 /**
  * setUp
  *
  * @access public
  * @return void
  */
 public function setUp()
 {
     if (is_null($this->stream)) {
         $this->stream = \Kafka\Socket::createFromStream(fopen('php://temp', 'w+b'));
     }
     $this->stream->rewind();
 }
Exemplo n.º 2
0
 /**
  * setUp
  *
  * @access public
  * @return void
  */
 public function setUp()
 {
     $this->stream = \Kafka\Socket::createFromStream(fopen('php://temp', 'w+b'));
 }