| | |
| | | |
| | | @classmethod |
| | | def smembers(cls, redis_, key, auto_free=True): |
| | | return cls.exec("smembers", key, lambda: cls.__request(cls.__get_db(redis_), "smembers", key)) |
| | | result = cls.exec("smembers", key, lambda: cls.__request(cls.__get_db(redis_), "smembers", key)) |
| | | if type(result)==list: |
| | | result = set(result) |
| | | return result |
| | | |
| | | @classmethod |
| | | def srem(cls, redis_, key, val, auto_free=True): |
| | |
| | | |
| | | def request(data_json): |
| | | if type(data_json) == set: |
| | | data_json =list(data_json) |
| | | data_json = list(data_json) |
| | | data_bytes = socket_util.load_header(json.dumps(data_json).encode('utf-8')) |
| | | sk = socket_util.create_socket(SERVER_HOST, SERVER_PORT) |
| | | try: |
| | |
| | | fdata = {"type": "kp_msg", "data": {"ctype": "kp_msg", "data": {"msg": msg}}} |
| | | return fdata |
| | | |
| | | |
| | | # ------------------------------L2订阅列表------------------------------------ |
| | | def load_l2_subscript_codes(datas): |
| | | fdata = {"type": "l2_subscript_codes", "data": {"ctype": "l2_subscript_codes", "data": datas}} |
| | | return fdata |
| | | return fdata |