Update worker.go
This commit is contained in:
parent
d36dcb7fc2
commit
66e96d57ac
@ -219,6 +219,15 @@ func (worker *Worker) customeHandler(inpack *inPack) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Graceful shutdown for worker
|
||||||
|
func (worker *Worker) Stop() {
|
||||||
|
worker.Lock()
|
||||||
|
defer worker.Unlock()
|
||||||
|
if worker.running == true {
|
||||||
|
close(worker.in)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Close connection and exit main loop
|
// Close connection and exit main loop
|
||||||
func (worker *Worker) Close() {
|
func (worker *Worker) Close() {
|
||||||
worker.Lock()
|
worker.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user