[Python] Is there a way to isolate redis-py pipelines so they are not prematurely flushed by...

Discussão em 'Python' iniciado por Stack, Fevereiro 14, 2025.

  1. Stack

    Stack Membro Participativo

    Is there a way to isolate pipelines between jobs or threads?

    My Redis wrapper has 2 methods:

    def queue_redis_message_on_pipeline(message, pipeline):
    pipe = pipeline or get_websocket_redis_client().pipeline()
    ...
    pipe.publish(message)

    def execute_redis_pipeline(pipeline):
    pipe = pipeline or get_websocket_redis_client().pipeline()
    pipe.execute



    It's all the same pipeline singleton. There are async workers that are using the same pipeline but may either A. flush the pipeline prematurely B. compound the pipeline and cause a network connection Out Of Memory error. Any suggestions?

    Continue reading...

Compartilhe esta Página