Parcourir la source

添加支持context接口

fancl il y a 2 ans
Parent
commit
89e45ff42a
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  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 {