Rename to hdlrWrappers for symmetry sake
This commit is contained in:
parent
96d7975052
commit
5e364693ee
@ -18,7 +18,7 @@ type options struct {
|
||||
advertise string
|
||||
id string
|
||||
version string
|
||||
wrappers []HandlerWrapper
|
||||
hdlrWrappers []HandlerWrapper
|
||||
subWrappers []SubscriberWrapper
|
||||
}
|
||||
|
||||
@ -159,7 +159,7 @@ func Metadata(md map[string]string) Option {
|
||||
// Adds a handler Wrapper to a list of options passed into the server
|
||||
func WrapHandler(w HandlerWrapper) Option {
|
||||
return func(o *options) {
|
||||
o.wrappers = append(o.wrappers, w)
|
||||
o.hdlrWrappers = append(o.hdlrWrappers, w)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ func newRpcServer(opts ...Option) Server {
|
||||
rpc: &server{
|
||||
name: options.name,
|
||||
serviceMap: make(map[string]*service),
|
||||
wrappers: options.wrappers,
|
||||
hdlrWrappers: options.hdlrWrappers,
|
||||
},
|
||||
handlers: make(map[string]Handler),
|
||||
subscribers: make(map[*subscriber][]broker.Subscriber),
|
||||
|
@ -76,7 +76,7 @@ type server struct {
|
||||
freeReq *request
|
||||
respLock sync.Mutex // protects freeResp
|
||||
freeResp *response
|
||||
wrappers []HandlerWrapper
|
||||
hdlrWrappers []HandlerWrapper
|
||||
}
|
||||
|
||||
// Is this an exported - upper case - name?
|
||||
@ -256,8 +256,8 @@ func (s *service) call(ctx context.Context, server *server, sending *sync.Mutex,
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := len(server.wrappers); i > 0; i-- {
|
||||
fn = server.wrappers[i-1](fn)
|
||||
for i := len(server.hdlrWrappers); i > 0; i-- {
|
||||
fn = server.hdlrWrappers[i-1](fn)
|
||||
}
|
||||
|
||||
errmsg := ""
|
||||
@ -266,7 +266,6 @@ func (s *service) call(ctx context.Context, server *server, sending *sync.Mutex,
|
||||
errmsg = err.Error()
|
||||
}
|
||||
|
||||
|
||||
server.sendResponse(sending, req, replyv.Interface(), codec, errmsg, true)
|
||||
server.freeRequest(req)
|
||||
return
|
||||
@ -323,8 +322,8 @@ func (s *service) call(ctx context.Context, server *server, sending *sync.Mutex,
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := len(server.wrappers); i > 0; i-- {
|
||||
fn = server.wrappers[i-1](fn)
|
||||
for i := len(server.hdlrWrappers); i > 0; i-- {
|
||||
fn = server.hdlrWrappers[i-1](fn)
|
||||
}
|
||||
|
||||
// client.Stream request
|
||||
|
@ -31,7 +31,6 @@ type Server interface {
|
||||
Stop() error
|
||||
}
|
||||
|
||||
|
||||
type Publication interface {
|
||||
Topic() string
|
||||
Message() interface{}
|
||||
|
Loading…
Reference in New Issue
Block a user