Added Stop/WaitRunning methods

This commit is contained in:
Dmitry Krylov 2022-01-04 15:44:33 +03:00
parent d484cb3b96
commit a20b263b9e

View File

@ -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()
} }