added new socket manager, errorhandling and testing is not finished yet
This commit is contained in:
42
libs/React/Stream/ReadableStream.php
Normal file
42
libs/React/Stream/ReadableStream.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace React\Stream;
|
||||
|
||||
use Evenement\EventEmitter;
|
||||
|
||||
class ReadableStream extends EventEmitter implements ReadableStreamInterface
|
||||
{
|
||||
protected $closed = false;
|
||||
|
||||
public function isReadable()
|
||||
{
|
||||
return !$this->closed;
|
||||
}
|
||||
|
||||
public function pause()
|
||||
{
|
||||
}
|
||||
|
||||
public function resume()
|
||||
{
|
||||
}
|
||||
|
||||
public function pipe(WritableStreamInterface $dest, array $options = array())
|
||||
{
|
||||
Util::pipe($this, $dest, $options);
|
||||
|
||||
return $dest;
|
||||
}
|
||||
|
||||
public function close()
|
||||
{
|
||||
if ($this->closed) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->closed = true;
|
||||
$this->emit('end', array($this));
|
||||
$this->emit('close', array($this));
|
||||
$this->removeAllListeners();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user