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

Comments

Projects
None yet
2 participants
@cheatfate
Copy link
Member

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.

@dom96 dom96 closed this in c2b16b4 Nov 13, 2018

dom96 added a commit that referenced this issue Nov 13, 2018

Merge pull request #9687 from narimiran/fix-7192
export `asyncdispatch.callSoon` (fixes #7192)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.