Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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()
Exemple #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()
Exemple #7
0
def kill_client(client_id):
  return discard_client(get_client(client_id))
Exemple #8
0
def kill_client(client_id):
  return discard_client(get_client(client_id),True)
Exemple #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)]