Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
<?php
2
 
3
namespace React\Stream;
4
 
5
use Evenement\EventEmitter;
6
 
7
class ReadableStream extends EventEmitter implements ReadableStreamInterface
8
{
9
    protected $closed = false;
10
 
11
    public function isReadable()
12
    {
13
        return !$this->closed;
14
    }
15
 
16
    public function pause()
17
    {
18
    }
19
 
20
    public function resume()
21
    {
22
    }
23
 
24
    public function pipe(WritableStreamInterface $dest, array $options = array())
25
    {
26
        Util::pipe($this, $dest, $options);
27
 
28
        return $dest;
29
    }
30
 
31
    public function close()
32
    {
33
        if ($this->closed) {
34
            return;
35
        }
36
 
37
        $this->closed = true;
38
        $this->emit('end', array($this));
39
        $this->emit('close', array($this));
40
        $this->removeAllListeners();
41
    }
42
}