예제 #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)]