Use new name
This commit is contained in:
@@ -5,12 +5,12 @@ import (
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/localhots/uberdaemon"
|
||||
"github.com/localhots/satan"
|
||||
)
|
||||
|
||||
// NumberPrinter is a daemon that prints numbers once in a while.
|
||||
type NumberPrinter struct {
|
||||
uberdaemon.BaseDaemon
|
||||
satan.BaseDaemon
|
||||
}
|
||||
|
||||
// Startup sets up panic handler and starts enqueuing number printing jobs.
|
||||
@@ -42,7 +42,7 @@ func (n *NumberPrinter) enqueue() {
|
||||
}
|
||||
}
|
||||
|
||||
func (n *NumberPrinter) makeActor(num int) uberdaemon.Actor {
|
||||
func (n *NumberPrinter) makeActor(num int) satan.Actor {
|
||||
return func() {
|
||||
if rand.Intn(20) == 0 {
|
||||
panic("Noooooooooo!")
|
||||
|
||||
+6
-6
@@ -7,8 +7,8 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/localhots/uberdaemon"
|
||||
"github.com/localhots/uberdaemon/example/daemons"
|
||||
"github.com/localhots/satan"
|
||||
"github.com/localhots/satan/example/daemons"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -19,10 +19,10 @@ func main() {
|
||||
log.SetOutput(ioutil.Discard)
|
||||
}
|
||||
|
||||
uberd := uberdaemon.New()
|
||||
uberd.AddDaemon(&daemons.NumberPrinter{})
|
||||
uberd.Start()
|
||||
defer uberd.Stop()
|
||||
s := satan.Summon()
|
||||
s.AddDaemon(&daemons.NumberPrinter{})
|
||||
s.Start()
|
||||
defer s.Stop()
|
||||
|
||||
sig := make(chan os.Signal)
|
||||
signal.Notify(sig, os.Interrupt)
|
||||
|
||||
Reference in New Issue
Block a user