cppcoro
cppcoro copied to clipboard
Implement io_service::process_events_until_complete
Closes https://github.com/lewissbaker/cppcoro/issues/30
@lewissbaker Sorry I wasn't able to figure out a nice way to make it work with multiple threads. At the project I am working on, we decided to use explicit alternative using when_all_ready
that you mentioned in the issue.
Although I've added a test you requested, IMO if it's not possible to make it work nicely with multiple threads, it may be not worth having this merged in. There is already one way to achieve desired behavior anyway.
Feel free to close a pull request and you can either cherry pick the commit with typo fix or I can open a new PR, whichever is easiest for you.
@Uran198 Thanks for the update. I've cherry-picked the typo fix into master.
I'll think more about the process_events_until_complete()
implementation. I suspect it's not possible to wake up a particular thread from the event loop without having that thread effectively poll for completion on another thread by passing a shortish timeout to GetQueuedCompletionStatus()
.