(self, name, params=[], callback=None)
Subscribe to a collection
        Arguments:
        name - the name of the publication
        params - the subscription parameters

        Keyword Arguments:
        callback - a function callback that returns an error (if exists)
Subscribe to a collection
        Arguments:
        name - the name of the publication
        params - the subscription parameters
Subscribe to a collection Arguments : name - the name of the publication params - the subscription parameters
def subscribe(self, name, params=[], callback=None):
        """Subscribe to a collection
        Arguments:
        name - the name of the publication
        params - the subscription parameters

        Keyword Arguments:
        callback - a function callback that returns an error (if exists)"""
        self._wait_for_connect()

        def subscribed(error, sub_id):
            if error:
                self._remove_sub_by_id(sub_id)
                if callback:
                    callback(error.get('reason'))
                return
            if callback:
                callback(None)
            self.emit('subscribed', name)

        if name in self.subscriptions:
            raise MeteorClientException('Already subcribed to {}'.format(name))

        sub_id = self.ddp_client.subscribe(name, params, subscribed)
        self.subscriptions[name] = {
            'id': sub_id,
            'params': params
        }
def subscribe ( self , name , params = [ ] , callback = None ) : self . _wait_for_connect ( ) def subscribed ( error , sub_id ) : if error : self . _remove_sub_by_id ( sub_id ) if callback : callback ( error . get ( 'reason' ) ) return if callback : callback ( None ) self . emit ( 'subscribed' , name ) if name in self . subscriptions : raise MeteorClientException ( 'Already subcribed to {}' . format ( name ) ) sub_id = self . ddp_client . subscribe ( name , params , subscribed ) self . subscriptions [ name ] = { 'id' : sub_id , 'params' : params }