Perform necessary actions to start a worker
165591
protected function startup()
    {
        $this->getProcess()->setTitle('Starting');
        $this->registerSignalHandlers();

        $this->eventDispatcher->dispatch(
            ResqueWorkerEvents::START_UP,
            new WorkerEvent($this)
        );
    }
1086787
def start(self):
        
        setproctitle('oq-zworkerpool %s' % self.ctrl_url[6:])  # strip tcp://
        # start workers
        self.workers = []
        for _ in range(self.num_workers):
            sock = z.Socket(self.task_out_port, z.zmq.PULL, 'connect')
            proc = multiprocessing.Process(target=self.worker, args=(sock,))
            proc.start()
            sock.pid = proc.pid
            self.workers.append(sock)

        # start control loop accepting the commands stop and kill
        with z.Socket(self.ctrl_url, z.zmq.REP, 'bind') as ctrlsock:
            for cmd in ctrlsock:
                if cmd in ('stop', 'kill'):
                    msg = getattr(self, cmd)()
                    ctrlsock.send(msg)
                    break
                elif cmd == 'getpid':
                    ctrlsock.send(self.pid)
                elif cmd == 'get_num_workers':
                    ctrlsock.send(self.num_workers)
467183
def start(self):
        """"""
        if self.worker is None:
            raise DaemonError('No worker is defined for daemon')

        if os.environ.get('DAEMONOCLE_RELOAD'):
            # If this is actually a reload, we need to wait for the
            # existing daemon to exit first
            self._emit_message('Reloading {prog} ... '.format(prog=self.prog))
            # Orhpan this process so the parent can exit
            self._orphan_this_process(wait_for_parent=True)
            pid = self._read_pidfile()
            if (pid is not None and
                    self._pid_is_alive(pid, timeout=self.stop_timeout)):
                # The process didn't exit for some reason
                self._emit_failed()
                message = ('Previous process (PID {pid}) did NOT '
                           'exit during reload').format(pid=pid)
                self._emit_error(message)
                self._shutdown(message, 1)

        # Check to see if the daemon is already running
        pid = self._read_pidfile()
        if pid is not None:
            # I don't think this should not be a fatal error
            self._emit_warning('{prog} already running with PID {pid}'.format(
                prog=self.prog, pid=pid))
            return

        if not self.detach and not os.environ.get('DAEMONOCLE_RELOAD'):
            # This keeps the original parent process open so that we
            # maintain control of the tty
            self._fork_and_supervise_child()

        if not os.environ.get('DAEMONOCLE_RELOAD'):
            # A custom message is printed for reloading
            self._emit_message('Starting {prog} ... '.format(prog=self.prog))

        self._setup_environment()

        if self.detach:
            self._detach_process()
        else:
            self._emit_ok()

        if self.pidfile is not None:
            self._write_pidfile()

        # Setup signal handlers
        signal.signal(signal.SIGINT, self._handle_terminate)
        signal.signal(signal.SIGQUIT, self._handle_terminate)
        signal.signal(signal.SIGTERM, self._handle_terminate)

        self._run()
373332
public function start()
    {
        if ($this->isRunning()) {
            throw new StatusError('The worker pool has already been started.');
        }

        // Start up the pool with the minimum number of workers.
        $count = $this->minSize;
        while (--$count >= 0) {
            $worker = $this->createWorker();
            $this->idleWorkers->enqueue($worker);
        }

        $this->running = true;
    }
243638
async def init(app, loop):
    """"""
    app.session = aiohttp.ClientSession(loop=loop)  # to make web requests
    app.webhook = Webhook.Async(webhook_url, session=app.session)

    em = Embed(color=0x2ecc71)
    em.set_author('[INFO] Starting Worker')
    em.description = 'Host: {}'.format(socket.gethostname())

    await app.webhook.send(embed=em)
526566
async def worker_start(self, worker, exc=None):
        '''
        '''
        if not exc and self.name not in worker.servers:
            servers = await self.binds(worker, worker.sockets)
            for server in servers.values():
                server.event('stop').bind(lambda _, **kw: worker.stop())
715072
def launchBootstraps():
    """"""
    global processes
    worker_amount, verbosity, args = getArgs()
    was_origin = False

    if verbosity >= 1:
        sys.stderr.write("Launching {0} worker(s) using {1}.\n".format(
                worker_amount,
                os.environ['SHELL'] if 'SHELL' in os.environ else "an unknown shell",
            )
        )
        sys.stderr.flush()

    processes = []
    for _ in range(worker_amount):
        command = [sys.executable, "-m", BOOTSTRAP_MODULE] + args
        if verbosity >= 3:
            sys.stderr.write("Executing '{0}'...\n".format(command))
            sys.stderr.flush()
        processes.append(Popen(command))

        # Only have a single origin
        try:
            args.remove("--origin")
        except ValueError:
            pass
        else:
            was_origin = True

    if was_origin:
        # Only wait on the origin, this will return and notify the launcher
        # the the job has finished and start the cleanup phase
        try:
            processes[0].wait()
        except KeyboardInterrupt:
            pass
    else:
        for p in processes:
            p.wait()
1336395
public synchronized void startWorker(int i) throws IOException {
    Preconditions.checkState(mState == State.STARTED,
        "Must be in a started state to start workers");
    mWorkers.get(i).start();
  }
1190827
def start(path, query_parameters = {}, &block)
      if EventMachine.reactor_running?
        connect(path, query_parameters, &block)
      else
        if EventMachine.epoll?
          EventMachine.epoll
        elsif EventMachine.kqueue?
          EventMachine.kqueue
        else
          Kernel.warn('Your OS does not support epoll or kqueue.')
        end

        EventMachine.run do
          connect(path, query_parameters, &block)
        end
      end
    end
567707
def start(self):
        '''
        
        '''
        super(Master, self).start()
        if check_user(self.config['user']):
            self.action_log_info('Starting up')
            self.verify_hash_type()
            self.master.start()
494909
def execute(self):
        
        self.prepare_models()
        self.prepare_worker()
        if self.options.print_options:
            self.print_options()
        self.run()
11942
def spawn_worker(params):
    
    setup_logging(params)
    log.info("Adding worker: idx=%s\tconcurrency=%s\tresults=%s", params.worker_index, params.concurrency,
             params.report)
    worker = Worker(params)
    worker.start()
    worker.join()
988615
function handleWorkerRestart(worker, code, signal) {
		delete self.workers[worker.id];
		if (self.reviveWorkers) {
			var zombie = cluster.fork({
				config: JSON.stringify(self.config)
			});
			self.workers[zombie.id] = zombie;
		}
	}
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
717021
def launch(*args, **options):
    
    action = args[0]
    if options['reload']:
        logReload(options)
    else:
        assignDeploymentInstance(action, options)
241213
def start(self):
		
		if self._thread_running.is_set():
			raise RuntimeError('the JobManager has already been started')
		self._thread.start()
		self._thread_running.wait()
		return
1178214
public function start() {

        // we're activating!
        $this->is_active = true;

        $this->setup();

        foreach ( $this->workers as $name => $worker ) {

            $this->workers->start($name);

        }

        $this->becomeSupervisor();

        // start listening on socket
        try {

            $this->socket->listen();

        } catch (SocketException $e) {

            // something did wrong on socket...
            $this->logger->error($e->getMessage());
            $this->stop();
            $this->end(0);

        }

        // loop closed; if I'm the supervisor, I should clean everything
        if ( $this->is_supervisor && $this->is_active ) {
            $this->stop();
            $this->end(0);
        }

    }