golib/signal upgrade
This commit is contained in:
parent
9dbb3ea3fc
commit
939189448e
@ -1,13 +1,14 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mikespook/gearman-go/worker"
|
|
||||||
"github.com/mikespook/golib/signal"
|
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/mikespook/gearman-go/worker"
|
||||||
|
"github.com/mikespook/golib/signal"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ToUpper(job worker.Job) ([]byte, error) {
|
func ToUpper(job worker.Job) ([]byte, error) {
|
||||||
@ -68,7 +69,6 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
go w.Work()
|
go w.Work()
|
||||||
sh := signal.NewHandler()
|
signal.Bind(os.Interrupt, func() uint { return signal.BreakExit })
|
||||||
sh.Bind(os.Interrupt, func() bool { return true })
|
signal.Loop()
|
||||||
sh.Loop()
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user