Add circuit basics.

This commit is contained in:
Cody Soyland 2013-11-20 12:46:56 -06:00
parent 5f496df0bc
commit 35afb346cb
3 changed files with 41 additions and 0 deletions

View file

@ -0,0 +1,21 @@
package main
import (
_ "circuit/load/cmd"
"circuit/use/circuit"
"pilosa/cruncher"
"log"
)
func main() {
log.Println("Spawning...")
retrn, addr, err := circuit.Spawn("localhost", []string{"/cruncher"}, cruncher.App{})
if err != nil {
log.Fatal(err)
}
log.Println(retrn, addr)
circuit.Hang()
}

View file

@ -0,0 +1,8 @@
package main
import (
_ "circuit/load/worker"
_ "pilosa/cruncher"
)
func main() {}

View file

@ -4,6 +4,8 @@ import (
"pilosa/core"
"pilosa/db"
"log"
"circuit/use/circuit"
"time"
)
type Cruncher struct {
@ -53,3 +55,13 @@ func (c *Cruncher) HandleInbox() {
}
}
}
type App struct{}
func (App) Main() {
log.Println("Starting cruncher!")
time.Sleep(60*time.Second)
}
func init() {
circuit.RegisterFunc(App{})
}