Added multichannels and a simple channel-based bus

This commit is contained in:
2018-04-16 02:52:51 +02:00
parent 00d2bead8e
commit f8b43beaf5
9 changed files with 241 additions and 11 deletions

View File

@ -40,13 +40,16 @@ class MultiStreamChannel implements ChannelInterface
* {@inheritDoc}
*
* @param mixed $data
* @return void
* @return bool
*/
public function send($data)
public function send($data):bool
{
foreach ($this->clients as $client) {
$client->send($data);
foreach ($this->clients as $i=>$client) {
if (false === $client->send($data)) {
unset($this->clients[$i]);
}
}
return true;
}
/**