2021-07-16 04:10:34 +00:00
|
|
|
package queue
|
|
|
|
|
|
|
|
// Worker interface
|
|
|
|
type Worker interface {
|
2021-07-17 12:14:19 +00:00
|
|
|
BeforeRun() error
|
2021-07-16 11:26:19 +00:00
|
|
|
Run(chan struct{}) error
|
2021-07-17 12:14:19 +00:00
|
|
|
AfterRun() error
|
|
|
|
|
2021-07-16 11:26:19 +00:00
|
|
|
Shutdown() error
|
|
|
|
Queue(job interface{}) error
|
2021-07-16 04:10:34 +00:00
|
|
|
Capacity() int
|
|
|
|
Usage() int
|
|
|
|
}
|