Refactor lifecycle to scoped cleanup

This commit is contained in:
世界
2026-10-09 12:36:03 +08:00
parent a364ff4794
commit a691a44023
115 changed files with 1595 additions and 2030 deletions
+7 -6
View File
@@ -92,15 +92,16 @@ type Inbound struct {
references []string
}
func (i *Inbound) Start(stage adapter.StartStage) error {
func (i *Inbound) Start(stage adapter.StartStage, scope *adapter.Scope) error {
if stage != adapter.StartStateStart {
return nil
}
return i.service.Start()
}
func (i *Inbound) Close() error {
return i.service.Close()
err := i.service.Start()
if err != nil {
return err
}
scope.Add(i.service.Close)
return nil
}
type routerDialer struct {