Skip to content

Instantly share code, notes, and snippets.

@onionhammer
Created October 22, 2013 22:31
Show Gist options
  • Save onionhammer/7109327 to your computer and use it in GitHub Desktop.
Save onionhammer/7109327 to your computer and use it in GitHub Desktop.
Async IO jester issue
import sockets, asyncio, jester
import strtabs, htmlgen
let dispatch = newDispatcher()
##Import Web Handlers
get "/":
resp "Hello world"
##Procedures
proc UpdateLoop* =
while dispatch.poll(): nil
proc Initialize* () =
#Get port
let port = 8080
#Register jester with dispatcher
jester.register(dispatch, "", TPort(port))
UpdateLoop()
Initialize()
@onionhammer
Copy link
Author

Jester is making jokes at http://localhost:8080
Traceback (most recent call last)
main.nim(26) main
main.nim(12) UpdateLoop
asyncio.nim(623) poll
asyncio.nim(214) asyncSockHandleRead
httpserver.nim(485) :anonymous
httpserver.nim(387) nextAsync
sockets.nim(1248) readLine
os.nim(263) OSError
Error: unhandled exception: A non-blocking socket operation could not be complet
ed immediately.
[EOS]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment