HELLOACL.AUTHASYNC * Asynchronously assigns an ACL user to the current context. */
| 137 | /* HELLOACL.AUTHASYNC |
| 138 | * Asynchronously assigns an ACL user to the current context. */ |
| 139 | int AuthAsyncCommand_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { |
| 140 | if (argc != 2) return RedisModule_WrongArity(ctx); |
| 141 | |
| 142 | pthread_t tid; |
| 143 | RedisModuleBlockedClient *bc = RedisModule_BlockClient(ctx, HelloACL_Reply, HelloACL_Timeout, HelloACL_FreeData, TIMEOUT_TIME); |
| 144 | |
| 145 | |
| 146 | void **targs = RedisModule_Alloc(sizeof(void*)*2); |
| 147 | targs[0] = bc; |
| 148 | targs[1] = RedisModule_CreateStringFromString(NULL, argv[1]); |
| 149 | |
| 150 | if (pthread_create(&tid, NULL, HelloACL_ThreadMain, targs) != 0) { |
| 151 | RedisModule_AbortBlock(bc); |
| 152 | return RedisModule_ReplyWithError(ctx, "-ERR Can't start thread"); |
| 153 | } |
| 154 | |
| 155 | return REDISMODULE_OK; |
| 156 | } |
| 157 | |
| 158 | /* This function must be present on each Redis module. It is used in order to |
| 159 | * register the commands into the Redis server. */ |
nothing calls this directly
no test coverage detected