Added Stop/WaitRunning methods
This commit is contained in:
parent
d484cb3b96
commit
a20b263b9e
@ -226,7 +226,10 @@ func (worker *Worker) customeHandler(inpack *inPack) {
|
|||||||
func (worker *Worker) Stop() {
|
func (worker *Worker) Stop() {
|
||||||
// Set stopped flag
|
// Set stopped flag
|
||||||
worker.stopped = true
|
worker.stopped = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for completeness serving
|
||||||
|
func (worker *Worker) WaitRunning() {
|
||||||
// Wait for all the running activities has stopped
|
// Wait for all the running activities has stopped
|
||||||
worker.active.Wait()
|
worker.active.Wait()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user