(procedure string, m common.MethodInfo, invoker base.Invoker, opts ...tri.HandlerOption)
| 410 | } |
| 411 | |
| 412 | func (s *Server) registerServerStreamMethodHandler(procedure string, m common.MethodInfo, invoker base.Invoker, opts ...tri.HandlerOption) { |
| 413 | _ = s.triServer.RegisterServerStreamHandler( |
| 414 | procedure, |
| 415 | m.ReqInitFunc, |
| 416 | func(ctx context.Context, req *tri.Request, stream *tri.ServerStream) error { |
| 417 | args := []any{req.Msg, m.StreamInitFunc(stream)} |
| 418 | attachments := generateAttachments(req.Header()) |
| 419 | // inject attachments |
| 420 | ctx = context.WithValue(ctx, constant.AttachmentKey, attachments) |
| 421 | invo := invocation.NewRPCInvocation(m.Name, args, attachments) |
| 422 | res := invoker.Invoke(ctx, invo) |
| 423 | return res.Error() |
| 424 | }, |
| 425 | opts..., |
| 426 | ) |
| 427 | } |
| 428 | |
| 429 | func (s *Server) registerBidiStreamMethodHandler(procedure string, m common.MethodInfo, invoker base.Invoker, opts ...tri.HandlerOption) { |
| 430 | _ = s.triServer.RegisterBidiStreamHandler( |
no test coverage detected