// +build linux bsd darwin

package asynq

import (
	
	

	
)

// waitForSignals waits for signals and handles them.
// It handles SIGTERM, SIGINT, and SIGTSTP.
// SIGTERM and SIGINT will signal the process to exit.
// SIGTSTP will signal the process to stop processing new tasks.
func ( *Server) () {
	.logger.Info("Send signal TSTP to stop processing new tasks")
	.logger.Info("Send signal TERM or INT to terminate the process")

	 := make(chan os.Signal, 1)
	signal.Notify(, unix.SIGTERM, unix.SIGINT, unix.SIGTSTP)
	for {
		 := <-
		if  == unix.SIGTSTP {
			.Stop()
			continue
		}
		break
	}
}

func ( *Scheduler) () {
	.logger.Info("Send signal TERM or INT to stop the scheduler")
	 := make(chan os.Signal, 1)
	signal.Notify(, unix.SIGTERM, unix.SIGINT)
	<-
}