Skip to content

Calling subscribe breaks quit #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
arkanoid87 opened this issue Oct 28, 2022 · 0 comments
Open

Calling subscribe breaks quit #34

arkanoid87 opened this issue Oct 28, 2022 · 0 comments

Comments

@arkanoid87
Copy link

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant