Skip to content

RedisModule API for async RM_Call #7992

@MeirShpilraien

Description

@MeirShpilraien

Today, if calling RM_Call on a blocking command (like blpop or any module command for example that blocks the client), the command is executed but we get a REDISMODULE_REPLY_UNKNOWN as the RM_Call reply and there is no way to get the actual reply once the client is unblocked. I would like to suggest two approaches to solve it:

  1. Return a new reply type REDISMODULE_REPLY_BLOCKED that allows setting a callback on it that will be called when the client will be unblocked. Maybe something like : RM_SetOnUnblcokedCallback(OnUnblocked callback, void* pd)
  2. Introduce a new RM_CallAsync that will get OnDone callback. The new API will call this callback immediately if the client was not blocked or will return and call the callback when the client will get unblocked.

I am not going into implementation details and I am sure it will not be easy and there is a lot of edge cases to consider (in both approaches). But I would like to hear your thoughts about it before diving into details.

@oranagra @yossigo @itamarhaber @guybe7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions