Skip to content

Calling subscribe breaks quit #34

@arkanoid87

Description

@arkanoid87

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions