function try_subscribe(chan) {
        /* check channel existence */
        if (!streams.hasChan(chan) && !config.channels[chan]) {
                console.log("CHECK_CHAN: channel " + chan + " not found");

                throw "NotFound";
        }

        /* subscribe already started channel stream */
        if (streams.hasChan(chan)) {
                console.log("CHECK_CHAN: channel " + chan + " ready, stream");

                return;
        }

        throw "NotStarted";
}
/*
 * Attempt to get an already streaming channel
 */
Attempt to get an already streaming channel
Attempt to get an already streaming channel
function try_subscribe(chan) {
        if (!streams.hasChan(chan) && !config.channels[chan]) {
                console.log("CHECK_CHAN: channel " + chan + " not found");
                throw "NotFound";
        }
        if (streams.hasChan(chan)) {
                console.log("CHECK_CHAN: channel " + chan + " ready, stream");
                return;
        }
        throw "NotStarted";
}
function try_subscribe ( chan ) { if ( ! streams . hasChan ( chan ) && ! config . channels [ chan ] ) { console . log ( "CHECK_CHAN: channel " + chan + " not found" ) ; throw "NotFound" ; } if ( streams . hasChan ( chan ) ) { console . log ( "CHECK_CHAN: channel " + chan + " ready, stream" ) ; return ; } throw "NotStarted" ; }
Attempt to get an already streaming channel
Attempt to get an already streaming channel
/* check channel existence */ /* subscribe already started channel stream */