diff --git a/worker/worker.go b/worker/worker.go index 7ca1389..53c4869 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -219,6 +219,15 @@ func (worker *Worker) customeHandler(inpack *inPack) { } } +// Stop serving +func (worker *Worker) Stop() { + worker.Lock() + defer worker.Unlock() + if worker.running == true { + close(worker.in) + } +} + // Close connection and exit main loop func (worker *Worker) Close() { worker.Lock()