Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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
Exemplo n.º 4
0
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
Exemplo n.º 5
0
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()
Exemplo n.º 6
0
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()
Exemplo n.º 7
0
def kill_client(client_id):
  return discard_client(get_client(client_id))
Exemplo n.º 8
0
def kill_client(client_id):
  return discard_client(get_client(client_id),True)
Exemplo n.º 9
0
 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)]