(procedure string, m common.MethodInfo, invoker base.Invoker, opts ...tri.HandlerOption)
| 394 | } |
| 395 | |
| 396 | func (s *Server) registerClientStreamMethodHandler(procedure string, m common.MethodInfo, invoker base.Invoker, opts ...tri.HandlerOption) { |
| 397 | _ = s.triServer.RegisterClientStreamHandler( |
| 398 | procedure, |
| 399 | func(ctx context.Context, stream *tri.ClientStream) (*tri.Response, error) { |
| 400 | args := []any{m.StreamInitFunc(stream)} |
| 401 | attachments := generateAttachments(stream.RequestHeader()) |
| 402 | // inject attachments |
| 403 | ctx = context.WithValue(ctx, constant.AttachmentKey, attachments) |
| 404 | invo := invocation.NewRPCInvocation(m.Name, args, attachments) |
| 405 | res := invoker.Invoke(ctx, invo) |
| 406 | return wrapTripleResponse(res.Result()), res.Error() |
| 407 | }, |
| 408 | opts..., |
| 409 | ) |
| 410 | } |
| 411 | |
| 412 | func (s *Server) registerServerStreamMethodHandler(procedure string, m common.MethodInfo, invoker base.Invoker, opts ...tri.HandlerOption) { |
| 413 | _ = s.triServer.RegisterServerStreamHandler( |
no test coverage detected