taskiq-python / taskiq-redis

Broker and result backend for taskiq
MIT License
40 stars 18 forks source link

Custom serializers #56

Closed quizmoon closed 5 months ago

quizmoon commented 7 months ago

Would be great to have custom serializers in set/get results, or at least JSON, like it is implemented in the main project TaskIQ.

s3rius commented 7 months ago

True. Will add soon.

s3rius commented 7 months ago

Look, I've checked the code and you can do so already. You can set custom serializers in the constructor.

quizmoon commented 7 months ago

@s3rius , in the backend part it is hardcoded, e.g in "set_result":

        redis_set_params: Dict[str, Union[str, bytes, int]] = {
            "name": task_id,
            "value": pickle.dumps(result),
        }
s3rius commented 7 months ago

I see now. Accidentally skipped it. We will add a new parameter to the constructor.