enhancing logging. code broken
This commit is contained in:
7
hodu.go
7
hodu.go
@ -14,14 +14,13 @@ const (
|
||||
)
|
||||
|
||||
type Logger interface {
|
||||
Write (level LogLevel, fmt string, args ...interface{})
|
||||
Write (id string, level LogLevel, fmt string, args ...interface{})
|
||||
}
|
||||
|
||||
type Service interface {
|
||||
RunTask (wg *sync.WaitGroup) // blocking. run the actual task loop
|
||||
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
|
||||
WriteLog(id string, level LogLevel, fmt string, args ...interface{})
|
||||
}
|
||||
|
||||
type ExtTask func(svc Service, wg *sync.WaitGroup)
|
||||
|
Reference in New Issue
Block a user