From 939189448e7aae3f68c2c5a5f5abde9df3e0089d Mon Sep 17 00:00:00 2001 From: Xing Xing Date: Thu, 15 Jan 2015 10:28:21 +0800 Subject: [PATCH] golib/signal upgrade --- example/worker/worker.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/example/worker/worker.go b/example/worker/worker.go index 0fff06c..035a5f8 100644 --- a/example/worker/worker.go +++ b/example/worker/worker.go @@ -1,13 +1,14 @@ package main import ( - "github.com/mikespook/gearman-go/worker" - "github.com/mikespook/golib/signal" "log" "net" "os" "strings" "time" + + "github.com/mikespook/gearman-go/worker" + "github.com/mikespook/golib/signal" ) func ToUpper(job worker.Job) ([]byte, error) { @@ -68,7 +69,6 @@ func main() { return } go w.Work() - sh := signal.NewHandler() - sh.Bind(os.Interrupt, func() bool { return true }) - sh.Loop() + signal.Bind(os.Interrupt, func() uint { return signal.BreakExit }) + signal.Loop() }