Added MultiStreamChannel to handle multiple endpoints
This commit is contained in:
@ -28,6 +28,8 @@ class StreamChannel implements ChannelInterface
|
||||
}
|
||||
|
||||
$this->stream = $stream;
|
||||
|
||||
stream_set_blocking($stream, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -49,8 +51,11 @@ class StreamChannel implements ChannelInterface
|
||||
public function receive()
|
||||
{
|
||||
$buf = fread($this->stream, 8192);
|
||||
if (!$buf) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return json_decode(rtrim($buf, "\0"));
|
||||
return json_decode(rtrim($buf, "\0"), true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user