Kraken\Channel\ChannelComposite::handlePushAsync PHP Method

handlePushAsync() protected method

protected handlePushAsync ( string $name, Kraken\Channel\Protocol\ProtocolInterface $message, integer $flags = Channel::MODE_DEFAULT ) : boolean
$name string
$message Kraken\Channel\Protocol\ProtocolInterface
$flags integer
return boolean
    protected function handlePushAsync($name, $message, $flags = Channel::MODE_DEFAULT)
    {
        $statusArray = null;
        foreach ($this->buses as $channel) {
            $statusArray = $this->combine($statusArray, $channel->push($name, $message, $flags), function ($in, $out) {
                return $in || $out;
            });
        }
        $statusArray = (array) $statusArray;
        $cnt = 0;
        $len = count($statusArray);
        foreach ($statusArray as $statusElement) {
            if ($statusElement === true) {
                $cnt++;
            }
        }
        $status = $cnt === $len;
        if ($status) {
            $this->emit('output', [$name, $message]);
        }
        return $status;
    }