// Start begins the core block handler which processes block and inv messages.
965319
func (sm *SyncManager) Start() {
	// Already started?
	if atomic.AddInt32(&sm.started, 1) != 1 {
		return
	}

	log.Trace("Starting sync manager")
	sm.wg.Add(1)
	go sm.blockHandler()
}
869491
func (p *Process) Start() (err error) {
	if p.command, err = p.startProcess(); err != nil {
		return err
	}
	p.log.Debugf("New process %s was started (PID: %d)", p.GetName(), p.GetPid())

	return nil
}
151039
func (b *batchProducer) Start() error {
	b.runningMu.Lock()
	defer b.runningMu.Unlock()

	if b.running {
		return ErrAlreadyStarted
	}

	go b.run()

	// We want run to run in the background (in a goroutine) but we don’t want to return until that
	// goroutine has actually entered its main loop. So we read from this non-buffered channel, which
	// will block until run writes a value to it.
	<-b.start

	b.running = true

	return nil
}
1132736
func (p *Peer) start() error {
	log.Tracef("Starting peer %s", p)

	negotiateErr := make(chan error, 1)
	go func() {
		if p.inbound {
			negotiateErr <- p.negotiateInboundProtocol()
		} else {
			negotiateErr <- p.negotiateOutboundProtocol()
		}
	}()

	// Negotiate the protocol within the specified negotiateTimeout.
	select {
	case err := <-negotiateErr:
		if err != nil {
			p.Disconnect()
			return err
		}
	case <-time.After(negotiateTimeout):
		p.Disconnect()
		return errors.New("protocol negotiation timeout")
	}
	log.Debugf("Connected to %s", p.Addr())

	// The protocol has been negotiated successfully so start processing input
	// and output messages.
	go p.stallHandler()
	go p.inHandler()
	go p.queueHandler()
	go p.outHandler()
	go p.pingHandler()

	// Send our verack message now that the IO processing machinery has started.
	p.QueueMessage(wire.NewMsgVerAck(), nil)
	return nil
}
135954
func (h *Handle) Start() error {
	if err := h.watcher.registerHandle(h); err != nil {
		return err
	}
	go h.deliver()
	return nil
}
1141442
func (p *Init) Start(ctx context.Context) error {
	p.mu.Lock()
	defer p.mu.Unlock()

	return p.initState.Start(ctx)
}
581228
func Start() {
	mux := &yarpcHTTPMux{
		handlers: make(map[string]http.Handler),
	}
	mux.HandleFunc("handlertimeout/raw", handlerTimeoutRawHandler)

	server = net.NewHTTPServer(
		&http.Server{
			Addr:         addr,
			Handler:      mux,
			ReadTimeout:  5 * time.Second,
			WriteTimeout: 5 * time.Second,
		})

	if err := server.ListenAndServe(); err != nil {
		log.Fatalf("failed to start HTTP server: %v", err)
	}
}
232456
func (c *Container) Start(ctx context.Context, r *task.StartRequest) (rproc.Process, error) {
	p, err := c.Process(r.ExecID)
	if err != nil {
		return nil, err
	}
	if err := p.Start(ctx); err != nil {
		return nil, err
	}
	if c.Cgroup() == nil && p.Pid() > 0 {
		cg, err := cgroups.Load(cgroups.V1, cgroups.PidPath(p.Pid()))
		if err != nil {
			logrus.WithError(err).Errorf("loading cgroup for %d", p.Pid())
		}
		c.cgroup = cg
	}
	return p, nil
}
770707
func (s *Server) Start() error {
	if len(s.getCommandLabels()) > 0 {
		s.updateLabels()
	}
	go s.heartbeat.Run()

	// If the server requested connections to it arrive over a reverse tunnel,
	// don't call Start() which listens on a socket, return right away.
	if s.useTunnel {
		return nil
	}
	return s.srv.Start()
}
190374
func (u *uidProcessor) Start(ctx context.Context, eventInfo *common.EventInfo) error {

	return u.createAndStart(ctx, eventInfo, false)
}
457445
func (c *ChainIndexer) Start(chain ChainIndexerChain) {
	events := make(chan ChainHeadEvent, 10)
	sub := chain.SubscribeChainHeadEvent(events)

	go c.eventLoop(chain.CurrentHeader(), events, sub)
}
967778
func (p *process) Start(ctx context.Context) error {
	_, err := p.shim.task.Start(ctx, &task.StartRequest{
		ID:     p.shim.ID(),
		ExecID: p.id,
	})
	if err != nil {
		return errdefs.FromGRPC(err)
	}
	return nil
}
125374
func (s *dockerLoggerServer) Start(ctx context.Context, req *proto.StartRequest) (*proto.StartResponse, error) {
	opts := &StartOpts{
		Endpoint:    req.Endpoint,
		ContainerID: req.ContainerId,
		Stdout:      req.StdoutFifo,
		Stderr:      req.StderrFifo,
		TTY:         req.Tty,

		TLSCert: req.TlsCert,
		TLSKey:  req.TlsKey,
		TLSCA:   req.TlsCa,
	}
	err := s.impl.Start(opts)
	if err != nil {
		return nil, err
	}
	resp := &proto.StartResponse{}
	return resp, nil
}
137636
func (q *SQSDispatcher) start(handle func(context.Context, *sqs.Message) error) {
	var wg sync.WaitGroup
	for {
		select {
		case <-q.stopped:
			wg.Wait()
			return
		default:
			ctx := q.Context

			resp, err := q.sqs.ReceiveMessage(&sqs.ReceiveMessageInput{
				QueueUrl:        aws.String(q.QueueURL),
				WaitTimeSeconds: aws.Int64(defaultWaitTime),
			})
			if err != nil {
				reporter.Report(ctx, err)
				continue
			}

			for _, m := range resp.Messages {
				wg.Add(1)
				go func(m *sqs.Message) {
					defer wg.Done()
					if err := q.handle(ctx, handle, m); err != nil {
						reporter.Report(ctx, err)
					}
				}(m)
			}
		}
	}
}
732166
func (s *Switch) Start() error {
	if !atomic.CompareAndSwapInt32(&s.started, 0, 1) {
		log.Warn("Htlc Switch already started")
		return errors.New("htlc switch already started")
	}

	log.Infof("Starting HTLC Switch")

	blockEpochStream, err := s.cfg.Notifier.RegisterBlockEpochNtfn(nil)
	if err != nil {
		return err
	}
	s.blockEpochStream = blockEpochStream

	s.wg.Add(1)
	go s.htlcForwarder()

	if err := s.reforwardResponses(); err != nil {
		s.Stop()
		log.Errorf("unable to reforward responses: %v", err)
		return err
	}

	return nil
}
151761
func (lb *LogBroker) Start(ctx context.Context) error {
	lb.mu.Lock()
	defer lb.mu.Unlock()

	if lb.cancelAll != nil {
		return errAlreadyRunning
	}

	lb.pctx, lb.cancelAll = context.WithCancel(ctx)
	lb.logQueue = watch.NewQueue()
	lb.subscriptionQueue = watch.NewQueue()
	lb.registeredSubscriptions = make(map[string]*subscription)
	lb.subscriptionsByNode = make(map[string]map[*subscription]struct{})
	return nil
}
411700
func (m *Command) Start() (err error) {
	defer close(m.Started)

	// Seed random number generator
	rand.Seed(time.Now().UTC().UnixNano())

	// SetupServer
	err = m.SetupServer()
	if err != nil {
		return errors.Wrap(err, "setting up server")
	}

	// SetupNetworking
	err = m.setupNetworking()
	if err != nil {
		return errors.Wrap(err, "setting up networking")
	}
	go func() {
		err := m.Handler.Serve()
		if err != nil {
			m.logger.Printf("handler serve error: %v", err)
		}
	}()

	// Initialize server.
	if err = m.Server.Open(); err != nil {
		return errors.Wrap(err, "opening server")
	}

	m.logger.Printf("listening as %s\n", m.listenURI)

	return nil
}