Unblock a client blocked by `RedisModule_BlockedClient`. This will trigger * the reply callbacks to be called in order to reply to the client. * The 'privdata' argument will be accessible by the reply callback, so * the caller of this function can pass any value that is needed in order to * actually reply to the client. * * A common usage for 'privdata' is a thread that computes something th
| 5624 | * RedisModule_BlockClientOnKeys() is accessible from the timeout |
| 5625 | * callback via RM_GetBlockedClientPrivateData). */ |
| 5626 | int RM_UnblockClient(RedisModuleBlockedClient *bc, void *privdata) { |
| 5627 | moduleSetThreadVariablesIfNeeded(); |
| 5628 | if (bc->blocked_on_keys) { |
| 5629 | /* In theory the user should always pass the timeout handler as an |
| 5630 | * argument, but better to be safe than sorry. */ |
| 5631 | if (bc->timeout_callback == NULL) return REDISMODULE_ERR; |
| 5632 | if (bc->unblocked) return REDISMODULE_OK; |
| 5633 | if (bc->client) moduleBlockedClientTimedOut(bc->client); |
| 5634 | } |
| 5635 | moduleUnblockClientByHandle(bc,privdata); |
| 5636 | return REDISMODULE_OK; |
| 5637 | } |
| 5638 | |
| 5639 | /* Abort a blocked client blocking operation: the client will be unblocked |
| 5640 | * without firing any callback. */ |
no test coverage detected