Cloudef / zig-aio

io_uring like asynchronous API and coroutine powered IO tasks for zig
https://cloudef.github.io/zig-aio/
MIT License
175 stars 6 forks source link

Simplistic non-blocking sleep() for coro #20

Closed Bob-van closed 3 weeks ago

Bob-van commented 3 weeks ago

To clarify more i would like to block a Task without blocking a Thread for x nanoseconds.

It could be that i dont know it is already in, i am kind new to this repo, but in documentation nor in code comments/methods is no mention how to do a non blocking sleep on spawned task thru coro scheduler. Would be a nice thing to do, since its really usefull.

Please either add the functionality or show ideally in documentation how to do so with current implementation. I REALLY tried and i dont want to have a outside thread pool just for sleep().

Robert V.

Cloudef commented 3 weeks ago

https://cloudef.github.io/zig-aio/aio-operations#timeout

Bob-van commented 3 weeks ago

I am sorry to bother you with such nonsense, i got confused by the "std.time.Timer.start" comment since i was looking for "std.time.sleep".

Really thanks for all the help / work you do.