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

Method registerServerStreamMethodHandler

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

Source from the content-addressed store, hash-verified

410}
411
412func (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
429func (s *Server) registerBidiStreamMethodHandler(procedure string, m common.MethodInfo, invoker base.Invoker, opts ...tri.HandlerOption) {
430 _ = s.triServer.RegisterBidiStreamHandler(

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 6

NewRPCInvocationFunction · 0.92
generateAttachmentsFunction · 0.85
HeaderMethod · 0.65
InvokeMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected