Created
October 22, 2013 22:31
-
-
Save onionhammer/7109327 to your computer and use it in GitHub Desktop.
Async IO jester issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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]