1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

add the wrappers back into the core router

This commit is contained in:
Asim Aslam
2019-06-07 15:02:19 +01:00
parent a2fbf19341
commit bfdec9e2e3
2 changed files with 47 additions and 15 deletions

View File

@ -202,6 +202,11 @@ func (s *service) call(ctx context.Context, router *router, sending *sync.Mutex,
return nil
}
// wrap the handler
for i := len(router.hdlrWrappers); i > 0; i-- {
fn = router.hdlrWrappers[i-1](fn)
}
// execute handler
if err := fn(ctx, r, replyv.Interface()); err != nil {
return err
@ -235,6 +240,11 @@ func (s *service) call(ctx context.Context, router *router, sending *sync.Mutex,
}
}
// wrap the handler
for i := len(router.hdlrWrappers); i > 0; i-- {
fn = router.hdlrWrappers[i-1](fn)
}
// client.Stream request
r.stream = true