From 1133e261bf9bd6c0786d32047824d7c278a7c583 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 30 Jan 2025 19:28:33 -0500 Subject: [PATCH] Add support for RunShutdownable to actorSet --- actorset.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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