Send Update operation.

@param Channel $channel Channel data

@return Operation The operation to track the channel update
321649
public function sendUpdateChannelOperation(Channel $channel)
    {
        $channelId = $channel->getId();
        Validate::notNull($channelId, 'channelId');

        return $this->_sendOperation(
            $channel,
            "Channels('{$channelId}')",
            Resources::HTTP_MERGE,
            [Resources::STATUS_ACCEPTED, Resources::STATUS_NO_CONTENT]);
    }
1298683
public function createLogger($channel)
    {
        Cascade::loadConfigFromArray($this->config);
        $logger = Cascade::getLogger($channel);
        $logger->pushProcessor(new PsrLogMessageProcessor());
        return $logger;
    }
1020707
public function moveMember($channel)
    {
        $deferred = new Deferred();

        if ($channel instanceof Channel) {
            $channel = $channel->id;
        }

        $this->http->patch(
            "guilds/{$this->guild_id}/members/{$this->id}",
            [
                'channel_id' => $channel,
            ]
        )->then(function () use ($deferred) {
            $deferred->resolve();
        }, \React\Partial\bind_right($this->reject, $deferred));

        // At the moment we are unable to check if the member
        // was moved successfully.

        return $deferred->promise();
    }
777729
public function channelStatus($channel = '')
    {
        $cmd = implode(' ', array('CHANNEL', 'STATUS'));
        if ($channel !== '') {
            $cmd .= ' "' . $channel . '"';
        }
        $result = $this->send($cmd);
        return intval($result->getResult());
    }
1115137
public function resetChannel($channel)
    {
        $op = $this->sendResetChannelOperation($channel);

        // waiting for reset operation finishes
        $op = $this->awaitOperation($op);

        // true if succeeded
        return $op->getState() == OperationState::Succeeded;
    }
1052180
public function setChannel(\CampaignChain\CoreBundle\Entity\Channel $channel)
    {
        $this->channel = $channel;

        return $this;
    }
277008
public static function update($sub_app_id, $channel, $params = null, $options = null)
    {
        $url = static::instanceUrlWithChannel($sub_app_id, $channel);
        return static::_directRequest('put', $url, $params, $options);
    }
457641
public function pop($channel = '')
    {
        $channel = $channel ?: static::$defaultChannel;
        return $this->channelOrFail($channel)->pop($channel);
    }
898805
public function buildChannel($channel, $max = 3, $refreshes = 'no')
    {
        $channels = $this->validateChannel($channel);

        $url = $this->getURL('channel');

        $headers = [
            'body' => [
                'private'   => $this->privateKey,
                'channel'   => $channels,
                'max'       => $max,
                'refreshes' => $refreshes
            ]
        ];

        $response = $this->processRequest($url, $headers, 'post');

        return $response;
    }
1063000
public function channel(string $channel): Observable
    {
        // Only join a channel once
        if (isset($this->channels[$channel])) {
            return $this->channels[$channel];
        }

        // Ensure we only get messages for the given channel
        $channelMessages = $this->messages->filter(function (Event $event) use ($channel) {
            return $event->getChannel() !== '' && $event->getChannel() === $channel;
        });

        $subscribe = $this->connected
            ->do(function () use ($channel) {
                // Subscribe to pusher channel after connected
                $this->send(Event::subscribeOn($channel));
            })
            ->flatMapTo(Observable::empty());

        // Observable representing channel events
        $this->channels[$channel] = $channelMessages
            ->merge($subscribe)
            ->filter([Event::class, 'subscriptionSucceeded'])
            ->retryWhen(function (Observable $errors) {
                return $errors->flatMap(function (Throwable $throwable) {
                    return $this->handleLowLevelError($throwable);
                });
            })
            ->finally(function () use ($channel) {
                // Send unsubscribe event
                $this->send(Event::unsubscribeOn($channel));

                // Remove our channel from the channel list so we don't resubscribe in case we reconnect
                unset($this->channels[$channel]);
            })
            ->singleInstance();

        return $this->channels[$channel];
    }
70859
final public function listen(string $channel): Promise
    {
        if (! $this->handle) {
            throw new FailureException('Not connected');
        }

        return $this->send("listen", $channel);
    }
54828
public function endAdvertisementChannel($channel, $cueId)
    {
        $op = $this->sendEndAdvertisementChannelOperation($channel, $cueId);

        // waiting for create operation finishes
        $op = $this->awaitOperation($op);

        // true if succeeded
        return $op->getState() == OperationState::Succeeded;
    }
351587
private function execute(Channel $channel): \Generator
    {
        try {
            $result = new ExitSuccess(yield call($this->function, $channel, ...$this->args));
        } catch (\Throwable $exception) {
            $result = new ExitFailure($exception);
        }

        if ($this->killed) {
            return; // Parent is not listening for a result.
        }

        // Attempt to return the result.
        try {
            try {
                yield $channel->send($result);
            } catch (SerializationException $exception) {
                // Serializing the result failed. Send the reason why.
                yield $channel->send(new ExitFailure($exception));
            }
        } catch (ChannelException $exception) {
            // The result was not sendable! The parent context must have died or killed the context.
        }
    }
256193
public function setChannel(array $channel)
    {
        foreach ($channel as $element => $value) {
            $setter = 'set' . ucfirst($element);

            if (method_exists($this, $setter)) {
                $this->$setter($value);
                unset($channel[$element]);
            }
        }

        $this->channel = $channel;

        return $this;
    }
228228
public function hangup($channel = false)
    {
        $cmd = 'HANGUP';
        if ($channel !== false) {
            $cmd .= ' "' . $channel . '"';
        }
        $result = $this->send($cmd);
        if ($result->isResult(-1)) {
            throw new ChannelDownException('Hangup failed');
        }
    }
388959
public function subscribe(ChannelInterface $channel, SubscriberInterface $subscriber)
    {
        $this->subscribers[$channel->getIdentifier()][$subscriber->getIdentifier()] = $subscriber;

        return $this;
    }
1319067
private function unlisten(string $channel): Promise
    {
        \assert(isset($this->listeners[$channel]), "Not listening on that channel");

        $emitter = $this->listeners[$channel];
        unset($this->listeners[$channel]);

        if (!$this->handle) {
            $promise = new Success; // Connection already closed.
        } else {
            $promise = new Coroutine($this->send([$this->handle, "unlistenAsync"], $channel));
        }

        $promise->onResolve([$emitter, "complete"]);
        return $promise;
    }