smol-rs / polling

Portable interface to epoll, kqueue, event ports, and wepoll
Apache License 2.0
551 stars 68 forks source link

Will "wait" return on events that have already happened? #168

Closed JosuGZ closed 11 months ago

JosuGZ commented 11 months ago

Let's say we have the following flow:

Time:  0.000 - Sleep 10 seconds
Time:  4.000 - A read event happens
Time: 10.000 - Sleep ends
Time: 10.001 - We call "modify" an express interest on the event
Time: 10.002 - We call "wait"

Currently I get the read event, but I'm not sure if this is guaranteed to happen (I think it should, since even without sleeping, events could happen just before the "modify").

Perhaps this could be clarified in the documentation.

notgull commented 11 months ago

Depends on the mode registered: