// Start starts the MakeyButtonDriver and polls the state of the button at the given interval.
//
// Emits the Events:
// 	Push int - On button push
//	Release int - On button release
//	Error error - On button error
12057
func (b *MakeyButtonDriver) Start() (err error) {
	state := 1
	go func() {
		timer := time.NewTimer(b.interval)
		timer.Stop()
		for {
			newValue, err := b.connection.DigitalRead(b.Pin())
			if err != nil {
				b.Publish(Error, err)
			} else if newValue != state && newValue != -1 {
				state = newValue
				if newValue == 0 {
					b.Active = true
					b.Publish(ButtonPush, newValue)
				} else {
					b.Active = false
					b.Publish(ButtonRelease, newValue)
				}
			}
			timer.Reset(b.interval)
			select {
			case <-timer.C:
			case <-b.halt:
				return
			}
		}
	}()
	return
}
1344156
func (g *Master) Start() (err error) {
	if rerr := g.robots.Start(!g.AutoRun); rerr != nil {
		err = multierror.Append(err, rerr)
		return
	}

	g.running.Store(true)

	if g.AutoRun {
		c := make(chan os.Signal, 1)
		g.trap(c)

		// waiting for interrupt coming on the channel
		<-c

		// Stop calls the Stop method on each robot in its collection of robots.
		g.Stop()
	}

	return err
}
1244767
func (m *Manager) Start() error {
	if !atomic.CompareAndSwapUint32(&m.started, 0, 1) {
		return nil
	}

	return nil
}
333419
func (driver *MesosExecutorDriver) Start() (mesosproto.Status, error) {
	driver.lock.Lock()
	defer driver.lock.Unlock()
	return driver.start()
}
1091700
func (r *Robots) Start(args ...interface{}) (err error) {
	autoRun := true
	if args[0] != nil {
		autoRun = args[0].(bool)
	}
	for _, robot := range *r {
		if rerr := robot.Start(autoRun); rerr != nil {
			err = multierror.Append(err, rerr)
			return
		}
	}
	return
}
423363
func (s *Stdout) Start() error {
	if os.Stdout == nil {
		return errors.New("stdout is not available")
	}
	return nil
}
376843
func (s *Service) Start(id int64, apistartrequestbodymessage *ApiStartRequestBodyMessage) *StartCall {
	c := &StartCall{s: s, urlParams_: make(gensupport.URLParams)}
	c.id = id
	c.apistartrequestbodymessage = apistartrequestbodymessage
	return c
}
879612
func (l *Lifecycle) Start(ctx context.Context) error {
	for _, hook := range l.hooks {
		if hook.OnStart != nil {
			l.logger.Printf("START\t\t%s()", hook.caller)
			if err := hook.OnStart(ctx); err != nil {
				return err
			}
		}
		l.numStarted++
	}
	return nil
}
664798
func (p *ProductBuilder) Start() {
	for {
		p.Build()
		fmt.Printf("Built %d %s\n", p.completed.Val(), p.name)
	}
}
1309781
func start() {
	fmt.Printf("Starting %s...", AppName)
	if err := Start(1); err != nil {
		failed(err)
	} else {
		fmt.Println("OK")
	}
}
329066
func (s *SimpleTimer) Start() {
	if s.start == nil {
		tmp := time.Now()
		s.start = &tmp
	}
}
431073
func (sit *SyncIntervalTimer) Start() {
	if sit.intervalTimer == nil {
	exitA:
		for {
			select {
			case sit.sync <- struct{}{}:
				<-sit.sync
			case <-sit.stop:
				break exitA
			}
		}
	} else {
	exitB:
		for {
			select {
			case <-sit.intervalTimer.C:
				if err := sit.f(); err != nil {
					if sit.onError != nil {
						sit.onError(err)
					}
				}
				select {
				case <-sit.stop:
					break exitB
				default:
				}
			case sit.sync <- struct{}{}:
				<-sit.sync
			case <-sit.stop:
				break exitB
			}
		}
	}
	close(sit.sync)
}
929167
func (c *Container) Start(ctx context.Context) error {
	if c.Engine == nil {
		return ErrNilEngine
	}
	startCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
	defer cancel()
	return c.Engine.VirtualizationStart(startCtx, c.ID)
}
987790
func (b *TemperatureDriver) Start() (err error) {
	// subscribe to temperature notifications
	b.adaptor().Subscribe(temperatureCharacteristic, func(data []byte, e error) {
		var l int8
		buf := bytes.NewBuffer(data)
		val, _ := buf.ReadByte()
		l = int8(val)

		b.Publish(b.Event(Temperature), l)
	})

	return
}
1146776
func (a *AdafruitMotorHatDriver) Start() (err error) {
	bus := a.GetBusOrDefault(a.connector.GetDefaultBus())

	if a.servoHatConnection, err = a.connector.GetConnection(servoHatAddress, bus); err != nil {
		return
	}

	if err = a.startDriver(a.servoHatConnection); err != nil {
		return
	}

	if a.motorHatConnection, err = a.connector.GetConnection(motorHatAddress, bus); err != nil {
		return
	}

	if err = a.startDriver(a.motorHatConnection); err != nil {
		return
	}

	return
}
1136788
func (ed *Dispatcher) Start() error {
	if !ed.setState(dispatcherStateInitial, dispatcherStateStarted) {
		return errors.New("cannot start dispatcher since it's not in its initial state")
	}

	ed.RegisterHandlers()

	if err := ed.initRegistrations(); err != nil {
		return errors.WithMessage(err, "error initializing registrations")
	}

	if ed.initialLastBlockNum > 0 {
		if err := ed.updateLastBlockNum(ed.initialLastBlockNum); err != nil {
			logger.Warnf("Unable to update last block num to %d: %s", ed.initialLastBlockNum, err)
		}
	}

	go func() {
		for {
			if ed.getState() == dispatcherStateStopped {
				break
			}

			logger.Debug("Listening for events...")
			e, ok := <-ed.eventch
			if !ok {
				break
			}

			logger.Debugf("Received event: %+v", reflect.TypeOf(e))

			if handler, ok := ed.handlers[reflect.TypeOf(e)]; ok {
				logger.Debugf("Dispatching event: %+v", reflect.TypeOf(e))
				handler(e)
			} else {
				logger.Errorf("Handler not found for: %s", reflect.TypeOf(e))
			}
		}
		logger.Debug("Exiting event dispatcher")
	}()
	return nil
}
514967
func (c *Consumer) Start(debug bool) error {
	if debug {
		for i := range c.handlers {
			log.Printf("Handler: topic=%s channel=%s\n", i.topic, i.channel)
		}
	}
	<-make(chan bool)
	return nil
}