-
Notifications
You must be signed in to change notification settings - Fork 114
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
Provide gRPC read handle to the Oak entrypoint #874
Comments
My preference would be towards the second approach:
Since it is more composable, and also plays better with IFC, especially when introducing per-user labels. For instance, this would make it easy for the "main" Node to act as a router based on the labels of individual gRPC invocations. |
It might be possible to use a procedural macro just like #[oak::main]
fn main(_: Handle) {
let node = RunningAverageDispatcher::new(Node::default());
let grpc_handle = oak::grpc::server::init();
oak::run_event_loop(node, grpc_handle);
} And it will be more convenient for developers since it will be just a regular |
procedural macros are a pain to maintain, we used to have them but we removed a while ago, I would avoid reintroducing them unless absolutely necessary |
Then it may just be an already existing oak::entrypoint!(oak_main => {
let node = RunningAverageDispatcher::new(Node::default());
let grpc_handle = oak::grpc::server::init();
oak::run_event_loop(node, grpc_handle);
}) This will allow a developer to choose which pseudo-Nodes to run and listen to (e.g. gRPC or HTTP) without introducing multiple new macros for each combination of pseudo-Nodes. But it will hide an |
Function that runs an event loop for a Node is called in the
entrypoint
(akaoak_main
) created by this macro:oak/sdk/rust/oak/src/lib.rs
Lines 567 to 576 in 6712ee6
This entrypoint requires an
in_handle
to receive messages, and this handle is provided by the Runtime upon creating this Node.In the case of gRPC server pseudo-Node this
in_handle
is created during the pseudo-Node creation. But this pseudo-Node is created by the original Node with an entrypoint, that at this point has already been created and provided with anin_handle
.And this results in a loop.
We need to change a way of how the initial Node is created.
We have several possible options:
impl
of the gRPC service, which is all in the same node.handle
returned by the former). This approach is similar to the current approach used in the C++ Runtime.Originated from a Slack thread: https://project-oak.slack.com/archives/CHE9E13C3/p1587068768173500
cc @tiziano88 @daviddrysdale
The text was updated successfully, but these errors were encountered: