-
-
Notifications
You must be signed in to change notification settings - Fork 548
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow async/await on multiple file descriptors
Provide two new public APIs: lwan_request_awaitv_any() and lwan_request_awaitv_all(), which, respectively, will await for an operation on at least one of the awaited file descriptors, returning the one that unblocked the coroutine, and for all the awaited file descriptors. The APIs are experimental but you can already see how much it improves the chat implementation of the websockets sample: now, instead of having to poll both the websocket and the pub/sub subscription, and wait a few milliseconds, it now instantaneously wakes up when there's data in either one of them, and processes only what has data. The chat now feels like a proper chat app (well, within reason for that crude app, but you get the idea). (As a side effect: we now send websocket pings periodically.) There's a lot to clean up here, but I'm tired and this will be done eventually.
- Loading branch information
Showing
9 changed files
with
323 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.