Re: asyncdispatch.poll() eats cpu

2018-02-20 Thread valex
-- if hasPendingOperations(): poll(500) else: sleep(500) -- This works in part. When I enter start, the load is again 50%. When I enter stop, the load is ok. I rewritten in my file the waitFor procedure: proc waitFor*[T](fut:

Re: asyncdispatch.poll() eats cpu

2018-02-20 Thread valex
import asyncdispatch, threadpool var started = false proc process() {.async.} = if started: return started = true echo "start process" while started: var client = newAsyncHttpClient() var resp = await

Re: asyncdispatch.poll() eats cpu

2018-02-20 Thread dom96
You're not performing any async IO. As soon as you do this won't be a problem. If you aren't intending to perform async IO then you don't need async.

Re: asyncdispatch.poll() eats cpu

2018-02-19 Thread dom96
It hasn't been fixed yet. But that's a pretty extreme case I think? Are you having problems in your application because of it?

asyncdispatch.poll() eats cpu

2018-02-19 Thread valex
Is this bug fixed yet? [https://github.com/nim-lang/Nim/issues/6929](https://github.com/nim-lang/Nim/issues/6929) In windows 10 cpu load 50%. How do I use asyncdispatch now? Nim 0.17.2