Exemplo n.º 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
}
Exemplo n.º 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
}
Exemplo n.º 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
}
Exemplo n.º 4
0
func main() {
	flag.Parse()
	consumer.Register("latency-test", "consume", *maxInFlight, HandleTest)
	consumer.Connect(*nsqdAddr)
	consumer.Start(true)
}