示例#1
0
文件: api.py 项目: yuvadm/shaveet
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
示例#2
0
文件: api.py 项目: yuvadm/shaveet
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
示例#3
0
文件: api.py 项目: urielka/shaveet
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
示例#4
0
文件: api.py 项目: urielka/shaveet
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
示例#5
0
文件: api.py 项目: yuvadm/shaveet
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()
示例#6
0
文件: api.py 项目: urielka/shaveet
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()
示例#7
0
文件: api.py 项目: yuvadm/shaveet
def kill_client(client_id):
  return discard_client(get_client(client_id))
示例#8
0
文件: api.py 项目: urielka/shaveet
def kill_client(client_id):
  return discard_client(get_client(client_id),True)
示例#9
0
文件: channel.py 项目: yuvadm/shaveet
 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)]