createFromStream() public static method

Optional method to set the internal stream handle
public static createFromStream ( $stream ) : Socket
$stream
return Socket
Beispiel #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();
 }
Beispiel #2
0
 /**
  * setUp
  *
  * @access public
  * @return void
  */
 public function setUp()
 {
     $this->stream = \Kafka\Socket::createFromStream(fopen('php://temp', 'w+b'));
 }