Expose EVLOOP_NONBLOCK
Summary:
This diff allows users to loop through EventBase without blocking if there are
not any events to process.
This is useful for sending and receiving requests on network, where users just
want to try if there are any events and do not want to block if not.
https://phabricator.fb.com/
D1373887 is an example where we find this feature
useful, otherwise we have to add an empty callback before loop.
event_base_.runInLoop([] {});
event_base_.loopOnce();
@davejwatson, @fugalh, @simpkins, @stepan: Could you please take a look at the
proposed changes and let me know if there is any better ways of doing this.
Thank you!
Test Plan:
I think this would not break anything, but we might want to do some performance
profiling if needed.
Reviewed By: hans@fb.com
Subscribers: simpkins, davejwatson, fugalh, stepan, folly@lists
FB internal diff:
D1383401