Skip to content

Commit c6f3c20

Browse files
committed
Complete the IReadableStream interface with a read method
1 parent 3c3c4ea commit c6f3c20

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Core/Streams/IReadableStream.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,16 @@ function resume() : void;
7373
* @return IReadableStream A readable stream from the destination.
7474
*/
7575
function pipe(IWritableStream $destination, bool $autoEnd = true) : IReadableStream;
76+
77+
/**
78+
* Reads the amount length of data from the stream.
79+
*
80+
* This method will emit a {@see StreamEvent::EVENT_DATA} event
81+
* with the read buffer as event data.
82+
*
83+
* @param integer $length The length of data to read.
84+
*
85+
* @return void
86+
*/
87+
function read(int $length) : void;
7688
}

0 commit comments

Comments
 (0)