Overview

Namespaces

  • Evenement
  • None
  • PHP
  • Psr
    • Http
      • Message
  • Ratchet
    • Http
    • RFC6455
      • Handshake
      • Messaging
    • Server
    • Session
      • Serialize
      • Storage
        • Proxy
    • Wamp
    • WebSocket
  • React
    • EventLoop
      • Tick
      • Timer
    • Socket
    • Stream
  • Symfony
    • Component
      • HttpFoundation
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
      • Routing
        • Annotation
        • Exception
        • Generator
          • Dumper
        • Loader
          • DependencyInjection
        • Matcher
          • Dumper
        • Tests
          • Annotation
          • Fixtures
            • AnnotatedClasses
            • OtherAnnotatedClasses
          • Generator
            • Dumper
          • Loader
          • Matcher
            • Dumper

Classes

  • BufferedSink
  • CompositeStream
  • DuplexResourceStream
  • ReadableResourceStream
  • ReadableStream
  • ThroughStream
  • Util
  • WritableResourceStream
  • WritableStream

Interfaces

  • DuplexStreamInterface
  • ReadableStreamInterface
  • WritableStreamInterface
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: namespace React\Stream;
 4: 
 5: use Evenement\EventEmitter;
 6: 
 7: class WritableStream extends EventEmitter implements WritableStreamInterface
 8: {
 9:     protected $closed = false;
10: 
11:     public function write($data)
12:     {
13:         return false;
14:     }
15: 
16:     public function end($data = null)
17:     {
18:         if (null !== $data) {
19:             $this->write($data);
20:         }
21: 
22:         $this->close();
23:     }
24: 
25:     public function isWritable()
26:     {
27:         return !$this->closed;
28:     }
29: 
30:     public function close()
31:     {
32:         if ($this->closed) {
33:             return;
34:         }
35: 
36:         $this->closed = true;
37:         $this->emit('close');
38:         $this->removeAllListeners();
39:     }
40: }
41: 
Ratchet API documentation generated by ApiGen 2.8.0