after called `AsyncFuture.fail`, the future is still running

2022-02-12 Thread royneary
@dom96: Oh, I see. I think that would require writing a custom `addTimer` that returns the FD though. How about changing `addTimer` to `proc addTimer*(timeout: int, oneshot: bool, cb: Callback): AsyncFD {.discardable.}`? (and making sure `proc unregister(fd: AsyncFD)` handles timer FDs correctl

after called `AsyncFuture.fail`, the future is still running

2022-02-12 Thread royneary
@dom96: I don't understand how this could work. I don't think there are FDs involved in the timer implementation, at least on posix. To my solution I should add, that it _only_ works on posix systems, not on Windows.

after called `AsyncFuture.fail`, the future is still running

2022-02-12 Thread royneary
For the special case of cancelling timers, that is futures returned by `sleepAsync`, I have an implementation. It is a bit hacky though as it manipulates the dispatcher's timer list: proc cancelTimer*(timer: Future[void], error: ref CatchableError) = let dispatcher = getGlobal

Setting up a Nim foundation

2021-10-26 Thread royneary
I can share a tiny bit of experience about a free software project that organizes itself as an eingetragener Verein (GNUnet e.V.). The Verein is managed through a git repository (. Maybe the documents in there can serve as an inspiration. I used to be a Be