add ffi & c++ wrapper for reactor and executor #48280
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a C++ API for working with Reactor and Executor.
The plan is to allow proxy and handler to work with these objects so that they may run their EventLoop as a Future within an Executor. This will make proxy and handler evented execution consistent with how connmgr works (i.e. always through an Executor), and will allow running other Futures concurrent with the EventLoop in the same thread. The EventLoop implementation already supports being run as a Future (via
EventLoop::exec_async()), so getting this to work is mostly a matter of exposing the needed pieces to C++.To start out, this PR adds an initial API to allow constructing Reactor and Executor from C++, as well as running the Executor.