Exemplo n.º 1
0
 def send(self):
     data = self.data
     data['uid'] = self.uid
     for receiver in self.receivers:
         key = rds_key_for_receiver(receiver)
         rds.lpush(key, json.dumps(data, cls=CJsonEncoder))
         rds.ltrim(key, 0, MAX_NOTIFY_COUNT)
Exemplo n.º 2
0
 def add_action(self, action_data):
     data = json.dumps(action_data, cls=CJsonEncoder)
     rds.lpush(self.db_key, data)
     rds.ltrim(self.db_key, 0, MAX_ACTIONS_COUNT)
Exemplo n.º 3
0
 def add_action(self, action_data):
     data = json.dumps(action_data, cls=CJsonEncoder)
     rds.lpush(self.db_key, data)
     rds.ltrim(self.db_key, 0, MAX_ACTIONS_COUNT)