-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin initialization and aggregation #281
Conversation
7c6305c
to
9a16367
Compare
850be8f
to
a4d67d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may in the future want to consider Tokio's JoinSet
instead of join_all
here. The reasons are subtle and will require careful consideration. First, I recommend reading the following:
We can go forward with the current design for now, but I want us to be thinking about this.
I had looked at |
Oh that's not what the |
Alternatively, the |
Ah, since it's configuration and/or policy data that is never modified, a |
1e88fe8
to
cc22b76
Compare
LGTM! Just needs a rebase to squash to one commit. Ping me after that, I'll re-review, and we can merge! |
9544158
to
5b67e99
Compare
Note: This PR relies on #278 which must be merged first.
This PR makes small adjustments to and expands upon #278 . The
PluginExecutor
now has astart_plugins()
async function which allows a set of plugins to be started concurrently. For a simple implementation, this required removing mutable state from thePluginExecutor
, hence the elimination of theest_ports
field.The
HcPluginCore
struct was added, which is intended to manage the protocol state of connections to each plugin and handle requesting info from a different plugin on behalf of another. TheHcPluginCore::new()
function takes an executor, and a set of(Plugin, Configuration)
pairs. This function starts all the plugins and also initializes them over gRPC by getting the schemas, setting the config, and getting the default policy expression. In order to hold important state and distinguish between an initialized and uninitializedPluginContext
, thePluginTransport
struct was created. It contains the context as well as handles for sending/receivingQuery
messages with the plugin on the other side. The goal is for the chunking portion of the protocol to be hidden within this struct