Exemple #1
0
// Open starts the service
func (s *Service) Open() error {
	go func() error {
		log.Info("starting dockerd service")
		if err := nsq.Register(TOPIC, "engine", maxInFlight, s.processNSQ); err != nil {
			return err
		}
		if err := nsq.Connect(s.Meta.NSQd...); err != nil {
			return err
		}
		s.Consumer = nsq.DefaultConsumer

		nsq.Start(true)
		return nil
	}()
	if err := s.setProvisioner(provision.PROVIDER_DOCKER); err != nil {
		return err
	}
	return nil
}
Exemple #2
0
// Open starts the service
func (s *Service) Open() error {
	if err := s.setEventsWrap(s.Eventsd); err != nil {
		return err
	}
	go func() error {
		log.Info("starting eventsd service")
		if err := nsq.Register(TOPIC, "engine", maxInFlight, s.processNSQ); err != nil {
			return err
		}
		if err := nsq.Connect(s.Meta.NSQd...); err != nil {
			return err
		}

		s.Consumer = nsq.DefaultConsumer

		nsq.Start(true)
		return nil
	}()
	return nil
}
Exemple #3
0
// Open starts the service
func (s *Service) Open() error {
	if err := s.setEventsWrap(); err != nil {
		return err
	}
	go func() error {
		log.Info("starting deployd agent service")
		if err := nsqc.Register(s.Meta.Name, "agent", maxInFlight, s.processNSQ); err != nil {
			return err
		}
		if err := nsqc.Connect(s.Meta.NSQd...); err != nil {
			return err
		}
		s.Consumer = nsqc.DefaultConsumer

		nsqc.Start(true)
		return nil
	}()
	if err := s.setProvisioner(); err != nil {
		return err
	}
	s.boot()
	return nil
}
Exemple #4
0
func main() {
	flag.Parse()
	consumer.Register("latency-test", "consume", *maxInFlight, HandleTest)
	consumer.Connect(*nsqdAddr)
	consumer.Start(true)
}