-
-
Save niv/9d4ad9fff35c57d36454bb799e83eaf3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc rawCommand*(redis: Redis, command: seq[string]): | |
Future[RedisReply] {.async.} = | |
## Execute a redis command. | |
await Future[void](redis.socketAvailable) | |
FutureVar[void](redis.socketAvailable).clean() | |
redis.socketAvailable.cb = proc () = discard | |
try: | |
await redis.writeCommand(command) | |
result = await readResponse(redis) | |
finally: | |
redis.socketAvailable.complete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment