Start commercial on channel.
Authenticated, required scope: channel_commercial

@param      $channel
@param int  $length
@param null $token
559507
public function postCommercial($channel, $length = 30, $token = null)
    {
        $token = $this->getToken($token);

        $channelAPI = new Channels($token);

        return $channelAPI->postCommercial($channel, $length);
    }
681665
function registerChannel(channel) {
  channels[channel.name] = channel;
  NativeBridge.registerChannel(channel.name, bridgeListener);
}
1224865
public static function generate(string $token = null, int $length = null): Token
    {
        if ($token == null) {
            if ($length == null) {
                $length = 64;
            }

            // generate token here
            if (function_exists('openssl_random_pseudo_bytes')) {
                $token = bin2hex(openssl_random_pseudo_bytes($length));

                if (strlen($token) > $length) {
                    // we have a string, now, take some random part there
                    $token = substr($token, rand(0, strlen($token) - $length), $length);
                }
            } else {
                // a fallback if openssl_random_pseudo_bytes is not accessible for some reason
                $someString = time() . '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' . Application::getKey();
                $token = substr(str_shuffle($someString), 0, $length);
            }
        }

        $config = Application::getConfig('session');

        $cookieName = static::getCookieName();
        if (is_string($cookieName) && strlen($cookieName) > 0) {
            $cookie = Cookie::rawSet($cookieName, $token, 0, '/', $config->get('domain', ''), $config->get('cookie_secure', false), false);
        } else {
            $cookie = null;
        }

        $token = new Token($token, $cookie);
        static::$token = $token;

        $sessionKeyName = static::getSessionKeyName();
        if (is_string($sessionKeyName) && strlen($sessionKeyName) > 0) {
            Session::set($sessionKeyName, $token);
        }

        return $token;
    }
1052180
public function setChannel(\CampaignChain\CoreBundle\Entity\Channel $channel)
    {
        $this->channel = $channel;

        return $this;
    }
1257120
@Override
    public void start() throws ChannelException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "start");
        }

        stop0Called = false;

        try {
            // If this is an inbound channel, we can pull out the listening host/port/endpointName.
            if (getConfig().isInbound()) {
                // Get access to the ChainData object for future use.
                ChainData chainData = SSLChannelProvider.getCfw().getInternalRunningChains(getConfig().getName())[0];
                ChannelData channelData = chainData.getChannelList()[0];
                Map<?, ?> channelProperties = channelData.getPropertyBag();
                this.inboundHost = (String) channelProperties.get("hostname");
                this.inboundPort = (String) channelProperties.get("port");
                // End point name will only ever get a value when running in was. Otherwise, null is fine.
                this.endPointName = (String) channelProperties.get("endPointName");
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "inboundHost = " + this.inboundHost
                                 + " inboundPort = " + this.inboundPort
                                 + " endPointName = " + this.endPointName);

                }
            }
        } catch (Exception e) {
            // no FFDC required
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Caught exception during start, throwing up stack.  " + e);
            }
            throw new ChannelException(e);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "start");
        }
    }
815750
def join_channel(self, channel, key=None, tags=None):
        """"""
        params = [channel]
        if key:
            params.append(key)
        self.send('JOIN', params=params, tags=tags)
385792
public function userSubscriptionChannel($channel, $user, $token = null)
    {
        return $this->sendRequest('GET', 'users/'.$user.'/subscriptions/'.$channel, $this->getToken($token));
    }
886512
public void start(String[] args) {
        try {
            processEnvironmentOptions();
            processCommandLineOptions(args);
            initializeLogging();
            validateOptions();
            final ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName(this.id).build();
            final ManagedChannelBuilder<?> channelBuilder = newChannelBuilder();
            final Handler handler = new Handler(chaincodeId, this);
            new ChaincodeSupportStream(channelBuilder, handler::onChaincodeMessage, handler::nextOutboundChaincodeMessage);
        } catch (Exception e) {
            logger.fatal("Chaincode could not start", e);
        }
    }
507954
private synchronized void createChannel(String channel) {
        if (!channelExists(channel)) {
            Queue queue = new Queue(channel, true, false, true);
            admin.declareQueue(queue);
            Binding binding = new Binding(channel, DestinationType.QUEUE, exchange.getName(), channel + ".#", null);
            admin.declareBinding(binding);
        }
    }
455534
async def join(self, channel, password=None):
        
        if self.in_channel(channel):
            raise AlreadyInChannel(channel)

        if password:
            await self.rawmsg('JOIN', channel, password)
        else:
            await self.rawmsg('JOIN', channel)
357322
public function showSlateChannel($channel, $duration, $assetId)
    {
        $op = $this->sendShowSlateChannelOperation($channel, $duration, $assetId);

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

        // true if succeeded
        return $op->getState() == OperationState::Succeeded;
    }
328232
function(channel){
    
        var tokenInfo   = this._tokenData,
            reader      = this._reader,
            value,
            i           =0,
            len         = tokenInfo.length,
            found       = false,
            token,
            info;
            
        //check the lookahead buffer first
        if (this._lt.length && this._ltIndex >= 0 && this._ltIndex < this._lt.length){  
                           
            i++;
            this._token = this._lt[this._ltIndex++];
            info = tokenInfo[this._token.type];
            
            //obey channels logic
            while((info.channel !== undefined && channel !== info.channel) &&
                    this._ltIndex < this._lt.length){
                this._token = this._lt[this._ltIndex++];
                info = tokenInfo[this._token.type];
                i++;
            }
            
            //here be dragons
            if ((info.channel === undefined || channel === info.channel) &&
                    this._ltIndex <= this._lt.length){
                this._ltIndexCache.push(i);
                return this._token.type;
            }
        }
        
        //call token retriever method
        token = this._getToken();

        //if it should be hidden, don't save a token
        if (token.type > -1 && !tokenInfo[token.type].hide){
                     
            //apply token channel
            token.channel = tokenInfo[token.type].channel;
         
            //save for later
            this._token = token;
            this._lt.push(token);

            //save space that will be moved (must be done before array is truncated)
            this._ltIndexCache.push(this._lt.length - this._ltIndex + i);  
        
            //keep the buffer under 5 items
            if (this._lt.length > 5){
                this._lt.shift();                
            }
            
            //also keep the shift buffer under 5 items
            if (this._ltIndexCache.length > 5){
                this._ltIndexCache.shift();
            }
                
            //update lookahead index
            this._ltIndex = this._lt.length;
        }
            
        /*
         * Skip to the next token if:
         * 1. The token type is marked as hidden.
         * 2. The token type has a channel specified and it isn't the current channel.
         */
        info = tokenInfo[token.type];
        if (info && 
                (info.hide || 
                (info.channel !== undefined && channel !== info.channel))){
            return this.get(channel);
        } else {
            //return just the type
            return token.type;
        }
    }
800376
protected function sendByHttp(string $url, string $token = null) : void
    {
        $content = ['event' => static::NAME, 'data' => $this->data];

        $request = new Request($url, $content);
        if ($token) {
            $request->addHeader(Header::AUTHORIZATION, $token);
        }

        $request->send();
    }
529581
public void startAdvertising(Beacon beacon, AdvertiseCallback callback) {
        mBeacon = beacon;
        mAdvertisingClientCallback = callback;
        startAdvertising();
    }
1080601
public function deleteStreamKey($channel, $token = null)
    {
        $token = $this->getToken($token);

        $channelAPI = new Channels($token);

        return $channelAPI->deleteStreamKey($channel);
    }
946655
public function authenticatedUserFollowsChannel($user, $channel, $options = [], $token = null)
    {
        $availableOptions = ['notifications'];

        return $this->sendRequest('PUT', 'users/'.$user.'/follows/channels/'.$channel, $this->getToken($token), $options, $availableOptions);
    }
514513
public void start() throws ChannelException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "start; " + getName());
        }
        if (stoppedFlag) // only start once
        {
            stoppedFlag = false;
            if (getConfig().isInboundChannel()) {
                inboundNetworkLayer = new UDPNetworkLayer(this, workQueueManager, getConfig().getHostname(), getConfig().getPort());
                try {
                    inboundNetworkLayer.initDatagramSocket(null);
                } catch (IOException e) {
                    stoppedFlag = true;
                    throw new RetryableChannelException(e);
                }

                String IPvType = "IPv4";
                if (inboundNetworkLayer.getDatagramSocket().getInetAddress() instanceof Inet6Address) {
                    IPvType = "IPv6";
                }

                String hostname = getConfig().getHostname();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(this, tc, "getHostname():  >" + hostname + "<");

                if ((hostname == null) || (hostname.equals("*"))) {
                    displayableHostName = "*  (" + IPvType + ")";
                } else {
                    InetAddress addr = inboundNetworkLayer.getDatagramSocket().getLocalAddress();
                    displayableHostName = addr.getHostName() + "  (" + IPvType + ": " + addr.getHostAddress() + ")";
                }
                Tr.info(tc, "CWUDP0001I", new Object[] { getConfig().getExternalName(), displayableHostName, String.valueOf(inboundNetworkLayer.getListenPort()) });
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "start");
        }
    }