implemented some more control channel handler in server.go

This commit is contained in:
2024-12-08 23:16:43 +09:00
parent 3c9b65476a
commit be0d31b06c
5 changed files with 194 additions and 17 deletions

View File

@ -17,11 +17,11 @@ const (
)
type Logger interface {
Write (id string, level LogLevel, fmtstr string, args ...interface{})
Write(id string, level LogLevel, fmtstr string, args ...interface{})
}
type Service interface {
RunTask (wg *sync.WaitGroup) // blocking. run the actual task loop. it must call wg.Done() upon exit from itself.
RunTask(wg *sync.WaitGroup) // blocking. run the actual task loop. it must call wg.Done() upon exit from itself.
StartService(data interface{}) // non-blocking. spin up a service. it may be invokded multiple times for multiple instances
StopServices() // non-blocking. send stop request to all services spun up
WaitForTermination() // blocking. must wait until all services are stopped