Airship\Cabin\Bridge\Blueprint\ChannelUpdates::notifyPeersOfNewUpdate PHP Méthode

notifyPeersOfNewUpdate() protected méthode

This propagates the new update through the network.
protected notifyPeersOfNewUpdate ( )
    protected function notifyPeersOfNewUpdate()
    {
        $state = State::instance();
        if (IDE_HACKS) {
            $state->hail = new Hail(new Client());
        }
        $resp = [];
        $peers = \Airship\loadJSON(ROOT . '/config/channel_peers/' . $this->channel . '.json');
        foreach ($peers as $peer) {
            foreach ($peer['urls'] as $url) {
                $resp[] = $state->hail->getAsync($url, ['challenge' => Base64UrlSafe::encode(\random_bytes(21))]);
            }
        }
        foreach ($resp as $r) {
            $r->then(function (ResponseInterface $response) {
                $body = (string) $response->getBody();
                $context = \json_decode(Binary::safeSubstr($body, 89));
                $this->log('Peer notified of channel update', LogLevel::INFO, $context);
            });
        }
    }