From 04aadebaa52f89d80d2b270e64bd7d383b3497b1 Mon Sep 17 00:00:00 2001 From: travisturner Date: Wed, 11 Dec 2013 10:13:51 -0600 Subject: [PATCH] stub out Cruncher.Run --- core/cruncher.go | 13 +++++++++++++ core/cruncher_test.go | 30 ++++++++++++++++++++++++++++++ core/service.go | 3 +++ 3 files changed, 46 insertions(+) create mode 100644 core/cruncher.go create mode 100644 core/cruncher_test.go diff --git a/core/cruncher.go b/core/cruncher.go new file mode 100644 index 000000000..1e2af8684 --- /dev/null +++ b/core/cruncher.go @@ -0,0 +1,13 @@ +package core + +import ( + "github.com/davecgh/go-spew/spew" +) + + +type Cruncher struct { +} + +func (cruncher *Cruncher) Run() { + spew.Dump("Cruncher.Run") +} diff --git a/core/cruncher_test.go b/core/cruncher_test.go new file mode 100644 index 000000000..9d0b42df3 --- /dev/null +++ b/core/cruncher_test.go @@ -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") + */ + + }) +} diff --git a/core/service.go b/core/service.go index 871022d8b..90b62b3de 100644 --- a/core/service.go +++ b/core/service.go @@ -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 {