> What is AsyncFD in terms of meaning? (I'm aware it's a distinct int32, but 
> what does that mean?)

FD is abbreviation of file descriptor, on Windows it's called Handle. FD/Handle 
is basically just and object and with AsyncFD meaning can be applied for 
asynchronous operation. On Windows it's the Handle that created with Ex 
variants of IO operations, like ReadFileEx, CreateFileEx etc. On Linux with 
epoll it's fd that's returned from epoll_create.

> Why does a Callback need to return a boolean? What does it mean to return 
> true/false?

Not necessarily but in your specific example, from the doc, 
[addTimer](https://nim-lang.org/docs/asyncdispatch.html#addTimer%2Cint%2Cbool%2CCallback)
 need to return boolean to identify whether it's running once or periodically.

> Why does the callback above only execute echoMe once? Shouldn't it do that 5 
> times given that poll lasts 500ms and the "true" parameter of addTimer means 
> it gets repeated?

`poll` only waiting "until" 500 ms, if timeout, throw `ValueError`, since 
`addTimer` expired already in 100 ms, so it doesn't need to waste 400 ms. Try 
changing to `runForever()` you'll get the uncaught ValueError (idk if this 
intended or bug).

> Is there any way to do this in a way that means I don't have to call poll 
> because the sources I'm skimming through atm make it sound like that would be 
> the task of a runtime to do manage that sort of thing

Directly or indirectly? Indirectly to avoid calling poll, you can just 
`runForever` it. To Directly avoiding, you can't because you need to yield the 
control to another operations/values in queue.

Reply via email to