Пример #1
0
// signal handling, centralized here
func installSignalHandlers() {
	sigChan := make(chan os.Signal, 1)
	signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT)
	go func() {
		<-sigChan
		// we got a signal, notify our modules:
		// - wr will interrupt anything waiting on a shard or
		//   keyspace lock
		// - worker will cancel any running job
		wrangler.SignalInterrupt()
		worker.SignalInterrupt()
	}()
}
Пример #2
0
// signal handling, centralized here
func installSignalHandlers() {
	sigChan := make(chan os.Signal, 1)
	signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT)
	go func() {
		<-sigChan
		// we got a signal, notify our modules:
		// - tm will interrupt anything waiting on a tablet action
		// - wr will interrupt anything waiting on a shard or
		//   keyspace lock
		initiator.SignalInterrupt()
		wrangler.SignalInterrupt()
		worker.SignalInterrupt()
	}()
}