MCPcopy Create free account
hub / github.com/apache/dubbo-go / registerClientStreamMethodHandler

Method registerClientStreamMethodHandler

protocol/triple/server.go:396–410  ·  view source on GitHub ↗
(procedure string, m common.MethodInfo, invoker base.Invoker, opts ...tri.HandlerOption)

Source from the content-addressed store, hash-verified

394}
395
396func (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
412func (s *Server) registerServerStreamMethodHandler(procedure string, m common.MethodInfo, invoker base.Invoker, opts ...tri.HandlerOption) {
413 _ = s.triServer.RegisterServerStreamHandler(

Callers 1

registerMethodHandlerMethod · 0.95

Implementers 8

ExchangeServerremoting/exchange_server.go
mockServerremoting/exchange_server_test.go
Serverremoting/getty/getty_server.go
Serverprotocol/grpc/server.go
Serverprotocol/grpc/internal/helloworld/serv
Serverprotocol/grpc/internal/routeguide/serv
Serverprotocol/triple/server.go
Serverprotocol/jsonrpc/server.go

Calls 8

NewRPCInvocationFunction · 0.92
generateAttachmentsFunction · 0.85
wrapTripleResponseFunction · 0.85
RequestHeaderMethod · 0.65
InvokeMethod · 0.65
ResultMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected