Skip to content
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

callSoon() is not working prior getGlobalDispatcher(). #7192

Closed
cheatfate opened this issue Feb 6, 2018 · 0 comments
Closed

callSoon() is not working prior getGlobalDispatcher(). #7192

cheatfate opened this issue Feb 6, 2018 · 0 comments
Labels
Async Everything related to Nim's async Regression

Comments

@cheatfate
Copy link
Member

cheatfate commented Feb 6, 2018

Following code

import asyncdispatch
proc testCallback() =
  echo "testCallback()"
when isMainModule:
  callSoon(testCallback)
  poll()

must work, but generates exception:

testCallback()
asyncdispatch.nim(1507)  asyncbug
asyncdispatch.nim(1511)  poll
asyncdispatch.nim(298)   runOnce
Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError]

While following code

import asyncdispatch

proc testCallback() =
  echo "testCallback()"

when isMainModule:
  var p = getGlobalDispatcher()
  callSoon(testCallback)
  poll()

working as expected, without any error.

This is regression bug introduced by one of the recent PRs, because original callSoon proc is now not exported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Async Everything related to Nim's async Regression
Projects
None yet
Development

No branches or pull requests

2 participants