bwindels / wwwee

wwwee, the wee webserver: a small, robust, low-resource and fast web application server for low workloads (home server, personal cloud)
GNU General Public License v3.0
26 stars 1 forks source link

Support timer async sources #13

Open bwindels opened 6 years ago

bwindels commented 6 years ago

This would be the first non-fd based async source. It would need a new event kind (TIMER) and a method on the io context to set a timer. It's an acceptable constraint that there may only be one timer at a time per connection, so allocation can be avoided. The timer is backed by the mio timeout, so the timeout would be the smallest timer set on any connection.

bwindels commented 6 years ago

this is useful to implement long-polling, e.g. do a request that waits for x amount of time to see if any events come in and then either return the events or in case of timeout an empty result.