Closed 13m0n4de closed 1 year ago
目前 StoredPipeline 是定义了一个全局 Dict 来存储 job_id => messages :
StoredPipeline
job_id => messages
app/utils/pipeline.py
EXTERNAL_JOB_STORE = {}
几乎照搬了 https://github.com/Bogdanp/dramatiq/issues/287 中的案例
计划将其改为 Redis 作为存储后端,与 ResultBackend 保持一致。
ResultBackend
已完成,见:
https://github.com/13m0n4de/fastapi-dramatiq-demo/blob/b5f7bba0350cb505a3bf13f83f819c208d7d652f/app/utils/pipeline.py#L1-L58
MessageData 的编解码使用自定义的 CustomJsonEncoder
CustomJsonEncoder
目前
StoredPipeline
是定义了一个全局 Dict 来存储job_id => messages
:app/utils/pipeline.py
几乎照搬了 https://github.com/Bogdanp/dramatiq/issues/287 中的案例
计划将其改为 Redis 作为存储后端,与
ResultBackend
保持一致。