From f57e69d1a6fddf64492d794cc150e4d74d0298b9 Mon Sep 17 00:00:00 2001 From: blob42 Date: Mon, 11 Sep 2023 14:53:30 +0200 Subject: [PATCH] no need for Shutdown() --- manager.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manager.go b/manager.go index 0c563c5..7a6a790 100644 --- a/manager.go +++ b/manager.go @@ -11,11 +11,16 @@ import ( var idGenerator = genId() +// The WorkUnit interface is used to define a unit of work. +// The Run method will be called in a goroutine. type WorkUnit interface { Run(UnitManager) - Shutdown() } +// The UnitManager interface is used to manage a unit of work. +// The ShouldStop method returns a channel that will be closed when the unit +// should stop. +// The Done method should be called when the unit is done. type UnitManager interface { ShouldStop() <-chan bool Done()