示例#1
0
// RunSimulator runs the example which creates jobs and sends them to the job queue
func RunSimulator() {

	// The simulater is a service which makes API calls
	// no need to run simulate's REST endpoint for this example
	c := simulate.NewConfig()
	simulate.Run(c)

	// Create job and send to scheduler
	j := simulate.NewJob()
	a := &MyActor{}
	j.Actor = a
	simulate.Jobs <- j
}
示例#2
0
func main() {

	c := simulate.NewConfig()
	simulate.Run(c)

	// Create job and send to scheduler
	j := simulate.NewJob()
	d := &MyActor{}
	j.Actor = d
	simulate.Jobs <- j
	sigc := make(chan os.Signal, 1)
	signal.Notify(sigc, syscall.SIGQUIT)
	<-sigc
}