stub out Cruncher.Run

This commit is contained in:
travisturner 2013-12-11 10:13:51 -06:00
parent cd6dc19ea1
commit 04aadebaa5
3 changed files with 46 additions and 0 deletions

13
core/cruncher.go Normal file
View file

@ -0,0 +1,13 @@
package core
import (
"github.com/davecgh/go-spew/spew"
)
type Cruncher struct {
}
func (cruncher *Cruncher) Run() {
spew.Dump("Cruncher.Run")
}

30
core/cruncher_test.go Normal file
View file

@ -0,0 +1,30 @@
package core
import (
"testing"
//"github.com/nu7hatch/gouuid"
"github.com/davecgh/go-spew/spew"
. "github.com/smartystreets/goconvey/convey"
)
func TestCruncher(t *testing.T) {
Convey("Basic Cruncher Tests", t, func() {
spew.Dump("cruncher test")
/*
cluster := NewCluster()
database := cluster.GetOrCreateDatabase("main")
frame := database.GetOrCreateFrame("general")
slice := database.GetOrCreateSlice(0)
fragment_id, _ := uuid.ParseHex("6a9aea17-2915-4eb4-858f-a8d7d4dc0a1e")
spew.Dump(fragment_id)
database.GetOrCreateFragment(frame, slice, fragment_id)
spew.Dump(database)
spew.Dump("DONE")
*/
})
}

View file

@ -50,6 +50,7 @@ type Service struct {
ConnectionRegisterChannel chan *PersistentConnection
Stats *Stats
//Cluster query.Cluster
Cruncher *Cruncher
}
func NewService(tcp, http *db.Location) *Service {
@ -59,6 +60,7 @@ func NewService(tcp, http *db.Location) *Service {
service.Outbox = make(chan *db.Envelope)
service.Inbox = make(chan *db.Message)
service.Stats = new(Stats)
service.Cruncher = new(Cruncher)
return service
}
@ -306,6 +308,7 @@ func (service *Service) Run() {
//go service.HandleInbox()
//go service.ServeHTTP()
go service.MetaWatcher()
go service.Cruncher.Run()
sigterm, sighup := service.GetSignals()
for {