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
| 5515 | * RedisModule_BlockClientOnKeys() is accessible from the timeout |
| 5516 | * callback via RM_GetBlockedClientPrivateData). */ |
| 5517 | int RM_UnblockClient(RedisModuleBlockedClient *bc, void *privdata) { |
| 5518 | if (bc->blocked_on_keys) { |
| 5519 | /* In theory the user should always pass the timeout handler as an |
| 5520 | * argument, but better to be safe than sorry. */ |
| 5521 | if (bc->timeout_callback == NULL) return REDISMODULE_ERR; |
| 5522 | if (bc->unblocked) return REDISMODULE_OK; |
| 5523 | if (bc->client) moduleBlockedClientTimedOut(bc->client); |
| 5524 | } |
| 5525 | moduleUnblockClientByHandle(bc,privdata); |
| 5526 | return REDISMODULE_OK; |
| 5527 | } |
| 5528 | |
| 5529 | /* Abort a blocked client blocking operation: the client will be unblocked |
| 5530 | * without firing any callback. */ |
no test coverage detected