-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Closed
Milestone
Description
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:
- Return a new reply type
REDISMODULE_REPLY_BLOCKEDthat 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) - Introduce a new
RM_CallAsyncthat 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.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done