Not sure how to title this, not even sure is it's a nim issue, async issue or redis lib issue, but the behaviour is that just by adding await redisClient.subscribe("whatever") you can make your code raise runtime exception.
import redis, asyncdispatch
proc asyncTest1() {.async.} =
# A, B ... Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError]
echo "A"
let redisClient = await openAsync()
await redisClient.subscribe("command")
echo "B"
await redisClient.quit()
echo "C" # never reached
proc asyncTest2() {.async.} =
# runs OK: prints A B C
echo "A"
let redisClient = await openAsync()
echo "B"
await redisClient.quit()
echo "C"
waitFor asyncTest1()
Not sure how to title this, not even sure is it's a nim issue, async issue or redis lib issue, but the behaviour is that just by adding
await redisClient.subscribe("whatever")
you can make your code raise runtime exception.