diff --git a/actorset.go b/actorset.go index eacced9..c43fdbc 100644 --- a/actorset.go +++ b/actorset.go @@ -16,6 +16,7 @@ type actorSets struct { configurable actorSet[Configurable] initializable actorSet[Initializable] runnable actorSet[Runnable] + runShutdownable actorSet[RunShutdownable] trimmable actorSet[Trimmable] } @@ -52,6 +53,7 @@ func (sets *actorSets) All() iter.Seq[actorSetIface] { yield(&sets.configurable) yield(&sets.initializable) yield(&sets.runnable) + yield(&sets.runShutdownable) yield(&sets.trimmable) } } @@ -66,7 +68,9 @@ func (this *actorSets) add(ctx context.Context, actor Actor) { done: done, order: this.nextOrder, } - if _, ok := actor.(Runnable); ok { + _, isRunnable := actor.(Runnable) + _, isRunShutdownable := actor.(RunShutdownable) + if isRunnable || isRunShutdownable { info.stopped = make(chan struct { }) } this.inf[actor] = info