Skip to content

Conversation

@ArtemyGordon
Copy link
Contributor

This PR simplifies how to register gRPC services

Previously, we had to create the service implementation and then wrap it into the generated *Server type manually:

let grpc_service = GrpcServiceImpl::new(app_context.clone());

service_context.configure_grpc_server(|builder| {
    builder.add_grpc_service(GrpcServiceServer::new(grpc_service.clone()));
});

Now we can register the service implementation directly:

service_context.configure_grpc_server(|builder| {
    builder.add_service(GrpcServiceImpl::new(app_context.clone()));
});

This works when GrpcServiceImpl is generated via the generate_grpc_service macro, which also implements the IntoGrpcServer trait for GrpcServiceImpl (so the builder can automatically wrap it into the corresponding *Server type under the hood)

@ArtemyGordon ArtemyGordon force-pushed the register-grpc-service branch from 017574a to 3dfdc9b Compare February 5, 2026 10:02
@amigin amigin merged commit 2aeb5f5 into MyJetTools:main Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants