Start the consumer.  This starts a listen loop on a zmq.PULL socket,
        calling ``self.handle`` on each incoming request and pushing the response
        on a zmq.PUSH socket back to the producer.
17723
def start(self):
        """"""
        if not self.initialized:
            raise Exception("Consumer not initialized (no Producer).")
        producer = self.producer
        context = zmq._Context()
        self.pull = context.socket(zmq.PULL)
        self.push = context.socket(zmq.PUSH)
        self.pull.connect('tcp://%s:%s' % (producer.host, producer.push_port))
        self.push.connect('tcp://%s:%s' % (producer.host, producer.pull_port))
        # TODO: notify the producer that this consumer's ready for work?
        self.listen()
346410
def start(self):
        
        self._thread = t = threading.Thread(target=self._monitor)
        t.setDaemon(True)
        t.start()
303425
def begin_application(self, req, res):
        
        # Add the middleware processing to the event loop - this *should*
        # change the call stack so any server errors do not link back to this
        # function
        self.loop.create_task(self.http_application.handle_client_request(req, res))
70666
def __start(self):
        
        thread = Thread(target=self.__loop, args=())
        thread.daemon = True  # daemonize thread
        thread.start()
        self.__enabled = True
1264465
async def run(self):
        
        self._logger.info("Agent started")
        self.__backend_socket.connect(self.__backend_addr)

        # Tell the backend we are up and have `concurrency` threads available
        self._logger.info("Saying hello to the backend")
        await ZMQUtils.send(self.__backend_socket, AgentHello(self.__friendly_name, self.__concurrency, self.environments))
        self.__last_ping = time.time()

        run_listen = self._loop.create_task(self.__run_listen())

        self._loop.call_later(1, self._create_safe_task, self.__check_last_ping(run_listen))

        await run_listen
1086357
def _start_socket(self):
        
        if self._bm is None:
            self._bm = BinanceSocketManager(self._client)

        self._conn_key = self._bm.start_depth_socket(self._symbol, self._depth_event)
        if not self._bm.is_alive():
            self._bm.start()

        # wait for some socket responses
        while not len(self._depth_message_buffer):
            time.sleep(1)
1049064
def start(self, *args, **kwargs):
        

        @wraps(self.callback)
        def callback():
            os.read(self.timer, 8)
            repeat = self.callback(*args, **kwargs)
            if not repeat:
                self.stop()

        spec = timerfd.itimerspec(self.interval, self.interval)
        timerfd.settime(self.timer, 0, spec)

        self.loop.remove_watcher(self.timer)
        self.loop.add_watcher(self.timer, callback)
1235561
async def start(self):
        
        self._is_running = True

        while self._is_running:
            try:
                zmq_msg = await self._socket.recv_multipart()

                message = Message()
                message.ParseFromString(zmq_msg[-1])

                await self._msg_router.route_msg(message)
            except DecodeError as e:
                LOGGER.warning('Unable to decode: %s', e)
            except zmq.ZMQError as e:
                LOGGER.warning('Unable to receive: %s', e)
                return
            except asyncio.CancelledError:
                self._is_running = False
923306
def run(self):
        '''
        
        '''
        context = zmq.Context()
        # the socket for incoming cache requests
        creq_in = context.socket(zmq.REP)
        creq_in.setsockopt(zmq.LINGER, 100)
        creq_in.bind('ipc://' + self.cache_sock)

        # the socket for incoming cache-updates from workers
        cupd_in = context.socket(zmq.SUB)
        cupd_in.setsockopt(zmq.SUBSCRIBE, b'')
        cupd_in.setsockopt(zmq.LINGER, 100)
        cupd_in.bind('ipc://' + self.update_sock)

        # the socket for the timer-event
        timer_in = context.socket(zmq.SUB)
        timer_in.setsockopt(zmq.SUBSCRIBE, b'')
        timer_in.setsockopt(zmq.LINGER, 100)
        timer_in.connect('ipc://' + self.upd_t_sock)

        poller = zmq.Poller()
        poller.register(creq_in, zmq.POLLIN)
        poller.register(cupd_in, zmq.POLLIN)
        poller.register(timer_in, zmq.POLLIN)

        # our serializer
        serial = salt.payload.Serial(self.opts.get('serial', ''))

        # register a signal handler
        signal.signal(signal.SIGINT, self.signal_handler)

        # secure the sockets from the world
        self.secure()

        log.info('ConCache started')

        while self.running:

            # we check for new events with the poller
            try:
                socks = dict(poller.poll(1))
            except KeyboardInterrupt:
                self.stop()
            except zmq.ZMQError as zmq_err:
                log.error('ConCache ZeroMQ-Error occurred')
                log.exception(zmq_err)
                self.stop()

            # check for next cache-request
            if socks.get(creq_in) == zmq.POLLIN:
                msg = serial.loads(creq_in.recv())
                log.debug('ConCache Received request: %s', msg)

                # requests to the minion list are send as str's
                if isinstance(msg, six.string_types):
                    if msg == 'minions':
                        # Send reply back to client
                        reply = serial.dumps(self.minions)
                        creq_in.send(reply)

            # check for next cache-update from workers
            if socks.get(cupd_in) == zmq.POLLIN:
                new_c_data = serial.loads(cupd_in.recv())
                # tell the worker to exit
                #cupd_in.send(serial.dumps('ACK'))

                # check if the returned data is usable
                if not isinstance(new_c_data, list):
                    log.error('ConCache Worker returned unusable result')
                    del new_c_data
                    continue

                # the cache will receive lists of minions
                # 1. if the list only has 1 item, its from an MWorker, we append it
                # 2. if the list contains another list, its from a CacheWorker and
                #    the currently cached minions are replaced with that list
                # 3. anything else is considered malformed

                try:

                    if not new_c_data:
                        log.debug('ConCache Got empty update from worker')
                        continue

                    data = new_c_data[0]

                    if isinstance(data, six.string_types):
                        if data not in self.minions:
                            log.debug('ConCache Adding minion %s to cache',
                                      new_c_data[0])
                            self.minions.append(data)

                    elif isinstance(data, list):
                        log.debug('ConCache Replacing minion list from worker')
                        self.minions = data

                except IndexError:
                    log.debug('ConCache Got malformed result dict from worker')
                    del new_c_data

                log.info('ConCache %s entries in cache', len(self.minions))

            # check for next timer-event to start new jobs
            if socks.get(timer_in) == zmq.POLLIN:
                sec_event = serial.loads(timer_in.recv())

                # update the list every 30 seconds
                if int(sec_event % 30) == 0:
                    cw = CacheWorker(self.opts)
                    cw.start()

        self.stop()
        creq_in.close()
        cupd_in.close()
        timer_in.close()
        context.term()
        log.debug('ConCache Shutting down')
614987
def run(self):
        
        listen_socket = self.create_socket(self.host, self.port)
        logger.info('Listening for telnet connections on %s port %r', self.host, self.port)

        try:
            while True:
                # Removed closed connections.
                self.connections = set([c for c in self.connections if not c.closed])

                # Ignore connections handling commands.
                connections = set([c for c in self.connections if not c.handling_command])

                # Wait for next event.
                read_list = (
                    [listen_socket, self._schedule_pipe[0]] +
                    [c.conn for c in connections])

                read, _, _ = select.select(read_list, [], [])

                for s in read:
                    # When the socket itself is ready, accept a new connection.
                    if s == listen_socket:
                        self._accept(listen_socket)

                    # If we receive something on our "call_from_executor" pipe, process
                    # these callbacks in a thread safe way.
                    elif s == self._schedule_pipe[0]:
                        self._process_callbacks()

                    # Handle incoming data on socket.
                    else:
                        self._handle_incoming_data(s)
        finally:
            listen_socket.close()
332758
def start(self):
        """"""
        self.zap_socket = self.context.socket(zmq.REP)
        self.zap_socket.linger = 1
        zapLoc = 'inproc://zeromq.zap.{}'.format(MultiZapAuthenticator.count)
        self.zap_socket.bind(zapLoc)
        self.log.debug('Starting ZAP at {}'.format(zapLoc))
330807
def start(self):
        
        with self._operational_lock:
            if self._thread is not None:
                raise ValueError("Dispatcher is already running.")

            flow_control = self._manager.flow_control
            worker = helper_threads.QueueCallbackWorker(
                self._queue,
                self.dispatch_callback,
                max_items=flow_control.max_request_batch_size,
                max_latency=flow_control.max_request_batch_latency,
            )
            # Create and start the helper thread.
            thread = threading.Thread(name=_CALLBACK_WORKER_NAME, target=worker)
            thread.daemon = True
            thread.start()
            _LOGGER.debug("Started helper thread %s", thread.name)
            self._thread = thread
1157015
def start(self):
        
        if not self.started:
            self.started = True
            self.executor = ThreadPoolExecutor(max_workers=32)
            self.poller = self.executor.submit(self.poll_events)
        else:
            raise IllegalStateError("Dispatcher is already started.")
75712
def start(self):
        
        with self._mgr_lock:
            with self._lock:
                self._use_count += 1

            if self._thread is None:
                self._create_all()
                self._thread = threading.Thread(target=self._thread_func)
                self._thread.setDaemon(SysConfig.get_all_thread_daemon())
                self._thread.start()
411209
def start_if_necessary(self):
        
        self.lock.acquire()
        try:
            if not self.listening:
                self.init()

                self.listening = True
                self.listening_thread = Thread(target=self.listen)
                self.listening_thread.daemon = True
                self.listening_thread.start()

                self.processing_thread = Thread(target=self.process)
                self.processing_thread.daemon = True
                self.processing_thread.start()
        finally:
            self.lock.release()
462898
def __start(self):  # pragma: no cover
        """"""

        assert not self._listener_thread

        self._listener_thread = threading.Thread(target=self.__run_listener,
                                                 name='clearly-listener')
        self._listener_thread.daemon = True
        self._listener_thread.start()
        self._wait_event.wait()
        self._wait_event.clear()
848031
def start(self):
        
        logging.info('ResponseBot started')

        handler_classes = handler_utils.discover_handler_classes(self.config.get('handlers_package'))
        if len(handler_classes) == 0:
            logging.warning('No handler found. Did you forget to extend BaseTweethandler? Check --handlers-module')

        while True:
            try:
                client = auth_utils.auth(self.config)

                listener = ResponseBotListener(client=client, handler_classes=handler_classes)

                stream = ResponseBotStream(client=client, listener=listener)
                stream.start()
            except (APIQuotaError, AuthenticationError, TweepError) as e:
                self.handle_error(e)
            else:
                break