def subscribe(client_id,channel_name): """ subscribe the client to the channel client_id - id of the client channel_name - name of the channel """ get_client(client_id).add_channel(channel_name) return 1
def unsubscribe(client_id,channel_name): """ unsubscribe the client to the channel client_id - id of the client channel_name - name of the channel """ get_client(client_id).remove_channel(channel_name) return 1
def get_client_channels(client_id): """ get all the clients subscribed to the channel channel_name - name of the channel """ return get_client(client_id).get_subscribed_channels()
def kill_client(client_id): return discard_client(get_client(client_id))
def kill_client(client_id): return discard_client(get_client(client_id),True)
def get_active_clients(self): now = int(time())#saves call to time return [client_id for client_id in self.clients if client_id and not "admin" in client_id and client_exists(client_id) and get_client(client_id).is_active(now)]