Browse Source

添加支持context接口

fancl 2 years ago
parent
commit
89e45ff42a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      service.go

+ 5 - 0
service.go

@@ -535,6 +535,11 @@ func (svr *Service) Shutdown() {
 	svr.cancelFunc()
 }
 
+//Context return the service context
+func (svr *Service) Context() context.Context {
+	return svr.ctx
+}
+
 func New(opts ...Option) *Service {
 	o := NewOptions()
 	for _, opt := range opts {