Rename to Shezmu
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
||||
# Satan example application
|
||||
# Shezmu example application
|
||||
|
||||
Describe the app here.
|
||||
|
||||
@@ -4,12 +4,12 @@ import (
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/localhots/satan"
|
||||
"github.com/localhots/shezmu"
|
||||
)
|
||||
|
||||
// NumberPrinter is a daemon that prints numbers once in a while.
|
||||
type NumberPrinter struct {
|
||||
satan.BaseDaemon
|
||||
shezmu.BaseDaemon
|
||||
}
|
||||
|
||||
// Startup sets up panic handler and starts enqueuing number printing jobs.
|
||||
@@ -33,7 +33,7 @@ func (n *NumberPrinter) generateNumbers() {
|
||||
}
|
||||
}
|
||||
|
||||
func (n *NumberPrinter) makeActor(num int) satan.Actor {
|
||||
func (n *NumberPrinter) makeActor(num int) shezmu.Actor {
|
||||
return func() {
|
||||
n.Log("Number printer says:", num)
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@ package daemons
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/localhots/satan"
|
||||
"github.com/localhots/shezmu"
|
||||
)
|
||||
|
||||
// PriceConsumer consumes price update messages and prints them to the console.
|
||||
type PriceConsumer struct {
|
||||
satan.BaseDaemon
|
||||
shezmu.BaseDaemon
|
||||
}
|
||||
|
||||
// PriceUpdate describes a price update message.
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/Shopify/sarama"
|
||||
"github.com/localhots/satan"
|
||||
"github.com/localhots/shezmu"
|
||||
)
|
||||
|
||||
// ConsumerState contains data that is required to create a Kafka consumer.
|
||||
@@ -18,10 +18,10 @@ type ConsumerState struct {
|
||||
Offset int64 `json:"offset"`
|
||||
}
|
||||
|
||||
// Subscriber is a dummy structure that implements satan.Subscriber interface.
|
||||
// Subscriber is a dummy structure that implements shezmu.Subscriber interface.
|
||||
type Subscriber struct{}
|
||||
|
||||
// Stream is an implementation of satan.Stremer for Kafka messaging queue.
|
||||
// Stream is an implementation of shezmu.Stremer for Kafka messaging queue.
|
||||
type Stream struct {
|
||||
messages chan []byte
|
||||
shutdown chan struct{}
|
||||
@@ -44,7 +44,7 @@ func Initialize(brokers []string) {
|
||||
defer log.Println("Kafka is initialized")
|
||||
|
||||
conf := sarama.NewConfig()
|
||||
conf.ClientID = "Satan Example"
|
||||
conf.ClientID = "Shezmu Example"
|
||||
|
||||
var err error
|
||||
if kafkaClient, err = sarama.NewClient(brokers, conf); err != nil {
|
||||
@@ -70,8 +70,8 @@ func Shutdown() {
|
||||
}
|
||||
}
|
||||
|
||||
// Subscribe creates a satan.Streamer implementation for Kafka messaging queue.
|
||||
func (s Subscriber) Subscribe(consumer, topic string) satan.Streamer {
|
||||
// Subscribe creates a shezmu.Streamer implementation for Kafka messaging queue.
|
||||
func (s Subscriber) Subscribe(consumer, topic string) shezmu.Streamer {
|
||||
c, ok := consumers[consumer]
|
||||
if !ok {
|
||||
panic(fmt.Errorf("Consumer %q has no config", consumer))
|
||||
|
||||
+6
-6
@@ -7,11 +7,11 @@ import (
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/localhots/satan"
|
||||
"github.com/localhots/satan/example/daemons"
|
||||
"github.com/localhots/satan/example/kafka"
|
||||
"github.com/localhots/satan/server"
|
||||
"github.com/localhots/satan/stats"
|
||||
"github.com/localhots/shezmu"
|
||||
"github.com/localhots/shezmu/example/daemons"
|
||||
"github.com/localhots/shezmu/example/kafka"
|
||||
"github.com/localhots/shezmu/server"
|
||||
"github.com/localhots/shezmu/stats"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -30,7 +30,7 @@ func main() {
|
||||
server := server.New(6464, statsServer)
|
||||
server.Start()
|
||||
|
||||
s := satan.Summon()
|
||||
s := shezmu.Summon()
|
||||
s.Subscriber = kafka.Subscriber{}
|
||||
s.DaemonStats = stats.NewGroup(statsLogger, statsServer)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user