This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// extend base Stream class by checking stream meta data for remaining stream buffer before reading from blocking streams | |
// heavily inspired by: https://github.com/clue/Worker/commit/8c6d7a4e733f0ee5aa431ffda1d4929229ae2336 | |
class StreamUnblock extends \React\Stream\Stream | |
{ | |
public function handleData($stream) | |
{ | |
// check stream meta data for remaining buffer | |
// yes, the manual explicitly says this value SHOULD NOT be used, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TimeoutException extends RuntimeException {} | |
class Timeout | |
{ | |
private $active; | |
public function set($seconds) | |
{ |