Export Start, Stop and Quiet method on Server type

This commit is contained in:
Ken Hibino
2020-04-12 11:00:45 -07:00
parent f9842ba914
commit 779065c269
4 changed files with 67 additions and 39 deletions

View File

@@ -7,8 +7,6 @@ import (
"os/signal"
"golang.org/x/sys/unix"
"github.com/hibiken/asynq/internal/base"
)
// waitForSignals waits for signals and handles them.
@@ -24,8 +22,7 @@ func (srv *Server) waitForSignals() {
for {
sig := <-sigs
if sig == unix.SIGTSTP {
srv.processor.stop()
srv.ps.SetStatus(base.StatusStopped)
srv.Quiet()
continue
}
break