Yeah, I have the killServer = true in a block somewhere.
Adding return after server.close() does work, but I need to mark server with
{.threadsafe.}. It also causes an issue with the HTTP Request (on the browser
side) doesn't get finished and just hangs. Interestingly enough this doesn't
try returning after server.close
Edit: also this is this bug
[https://github.com/nim-lang/Nim/issues/6186](https://github.com/nim-lang/Nim/issues/6186)
Edit2: do you set killServer = true in your code?
It now compiles successfully, but it doesn't seem to be killing the server when
I trip that killServer block. It will run over the line and continue on with
execution.
Try to add gcsafe pragma to your proc
So I've got some code like this:
import asyncDispatch
import asynchttpserver
# Create the server object and state data
var
server = newAsyncHttpServer()
let port = 8000
# ...
proc handleRequest(req: Request) {.async.}=
## Handle an