Method: Alain::Util.grpc_method

Defined in:
lib/alain/util.rb

.grpc_method(method, request, response) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/alain/util.rb', line 7

def grpc_method method, request, response
  "    async fn \#{snake_case(method)}(&self, request: Request<\#{namespace(request)}>) -> Result<Response<\#{namespace(response)}>, Status> {\n            let message: \#{namespace(request)} = request.into_inner();\n            Ok(Response::new(\#{namespace(response)} { }))\n        }\n  EOS\nend\n"