Start the executor for the given container
191578
@VisibleForTesting
  protected void startExecutor(final int container, Set<PackingPlan.InstancePlan> instances) {
    LOG.info("Starting a new executor for container: " + container);

    // create a process with the executor command and topology working directory
    final Process containerExecutor = startExecutorProcess(container, instances);

    // associate the process and its container id
    processToContainer.put(containerExecutor, container);
    LOG.info("Started the executor for container: " + container);

    // add the container for monitoring
    startExecutorMonitor(container, containerExecutor, instances);
  }
884287
public void start() {
		
		lock.lock();
		
		try {
			executorService = Executors.newSingleThreadScheduledExecutor();
			
			try {
				startUp();
			} catch (Throwable t) {
				LOGGER.info("Exception in service start up", t);
			}
			
			currentFuture = executorService.schedule(new RunOneIterationAndReschedule(), 0, TimeUnit.MILLISECONDS);
		} finally {
			lock.unlock();
		}
	}
102880
public function start(): void
    {
        $classAndMethodName = $this->classNameGenerator->getClassAndMethodNamesForCalling();

        $this->executor->exec(...$classAndMethodName);
    }
547113
private static void startIfNeeded()
   {
      if (!STARTED)
      {
         synchronized (JCRStatisticsManager.class)
         {
            if (!STARTED)
            {
               addTriggers();
               ExoContainer container = ExoContainerContext.getTopContainer();
               ManagementContext ctx = null;
               if (container != null)
               {
                  ctx = container.getManagementContext();
               }
               if (ctx == null)
               {
                  LOG.warn("Cannot register the statistics");
               }
               else
               {
                  ctx.register(new JCRStatisticsManager());
               }
               STARTED = true;
            }
         }
      }
   }
9554
public void start() throws Exception {
        logger.trace(Messages.get("info.container.starting"));
        SystemEventBus.publish(new StartEvent(this, application));
        doStart();
    }
273243
public synchronized void start() {
        if (future == null) {
            Runnable task = new Runnable() {
                                public void run() {
                                    try {
                                        accumulator.publish();
                                    } catch (Exception e) {
                                        handleException(e);
                                    }
                                }
                            };
            future = getExecutor().scheduleWithFixedDelay(task,
                                                          delayMillis, delayMillis,
                                                          TimeUnit.MILLISECONDS);
        }
    }
626498
def _run(name,
         cmd,
         exec_driver=None,
         output=None,
         stdin=None,
         python_shell=True,
         output_loglevel='debug',
         ignore_retcode=False,
         use_vt=False,
         keep_env=None):
    '''
    
    '''
    if exec_driver is None:
        exec_driver = _get_exec_driver()
    ret = __salt__['container_resource.run'](
        name,
        cmd,
        container_type=__virtualname__,
        exec_driver=exec_driver,
        output=output,
        stdin=stdin,
        python_shell=python_shell,
        output_loglevel=output_loglevel,
        ignore_retcode=ignore_retcode,
        use_vt=use_vt,
        keep_env=keep_env)

    if output in (None, 'all'):
        return ret
    else:
        return ret[output]
1266986
def start(self, stdout=subprocess.PIPE, stderr=subprocess.PIPE):
        
        if self.pre_start_check():
            # Some other executor (or process) is running with same config:
            raise AlreadyRunning(self)

        if self.process is None:
            command = self.command
            if not self._shell:
                command = self.command_parts

            env = os.environ.copy()
            env[ENV_UUID] = self._uuid
            popen_kwargs = {
                'shell': self._shell,
                'stdin': subprocess.PIPE,
                'stdout': stdout,
                'stderr': stderr,
                'universal_newlines': True,
                'env': env,
            }
            if platform.system() != 'Windows':
                popen_kwargs['preexec_fn'] = os.setsid
            self.process = subprocess.Popen(
                command,
                **popen_kwargs,
            )

        self._set_timeout()

        self.wait_for(self.check_subprocess)
        return self
197191
public ServiceContainer start(final List<ModelNode> containerDefinition, Collection<ServiceActivator> additionalActivators) throws ExecutionException, InterruptedException, ModuleLoadException {

        final long startTime = System.currentTimeMillis();


        if (java.util.logging.LogManager.getLogManager().getClass().getName().equals("org.jboss.logmanager.LogManager")) {
            try {
                Class.forName(org.jboss.logmanager.handlers.ConsoleHandler.class.getName(), true, org.jboss.logmanager.handlers.ConsoleHandler.class.getClassLoader());

                // Install JBoss Stdio to avoid any nasty crosstalk, after command line arguments are processed.
                StdioContext.install();
                final StdioContext context = StdioContext.create(
                        new NullInputStream(),
                        new LoggingOutputStream(org.jboss.logmanager.Logger.getLogger("stdout"), org.jboss.logmanager.Level.INFO),
                        new LoggingOutputStream(org.jboss.logmanager.Logger.getLogger("stderr"), org.jboss.logmanager.Level.ERROR)
                );
                StdioContext.setStdioContextSelector(new SimpleStdioContextSelector(context));

            } catch (Throwable ignored) {
            }
        }

        Module.registerURLStreamHandlerFactoryModule(Module.getBootModuleLoader().loadModule("org.jboss.vfs"));
        ServerEnvironment serverEnvironment = determineEnvironment(WildFlySecurityManager.getSystemPropertiesPrivileged(), WildFlySecurityManager.getSystemEnvironmentPrivileged(), ServerEnvironment.LaunchType.SELF_CONTAINED, startTime);
        final Bootstrap bootstrap = Bootstrap.Factory.newInstance();

        final Bootstrap.Configuration configuration = new Bootstrap.Configuration(serverEnvironment);

        configuration.setConfigurationPersisterFactory(
                new Bootstrap.ConfigurationPersisterFactory() {
                    @Override
                    public ExtensibleConfigurationPersister createConfigurationPersister(ServerEnvironment serverEnvironment, ExecutorService executorService) {

                        ExtensibleConfigurationPersister delegate;
                        delegate = persisterFactory.createConfigurationPersister(serverEnvironment, executorService);

                        configuration.getExtensionRegistry().setWriterRegistry(delegate);
                        return delegate;
                    }
                });


        configuration.setModuleLoader(Module.getBootModuleLoader());

        List<ServiceActivator> activators = new ArrayList<>();
        //activators.add(new ContentProviderServiceActivator(contentProvider));
        activators.addAll(additionalActivators);

        serviceContainer = bootstrap.startup(configuration, activators).get();
        return serviceContainer;
    }
292695
def run_in_executor(self, executor=None, func=None, *args):
        """"""
        return self.loop.run_in_executor(executor, func, *args)
91185
public static void run(StreamFunctionExecutor functionExecutor, String... args) {
        parseData(args, (data, isDebug) -> {
            try (InputStream input = data != null ? new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8)) : System.in) {
                functionExecutor.execute(input, System.out);
            } catch (Exception e) {
                exitWithError(isDebug, e);
            }
        });
    }
770390
def _run(name,
         cmd,
         output=None,
         no_start=False,
         stdin=None,
         python_shell=True,
         preserve_state=False,
         output_loglevel='debug',
         ignore_retcode=False,
         use_vt=False,
         keep_env=None):
    '''
    
    '''
    orig_state = state(name)
    exc = None
    try:
        ret = __salt__['container_resource.run'](
            name,
            cmd,
            container_type=__virtualname__,
            exec_driver=EXEC_DRIVER,
            output=output,
            no_start=no_start,
            stdin=stdin,
            python_shell=python_shell,
            output_loglevel=output_loglevel,
            ignore_retcode=ignore_retcode,
            use_vt=use_vt,
            keep_env=keep_env)
    except Exception:
        raise
    finally:
        # Make sure we stop the container if necessary, even if an exception
        # was raised.
        if preserve_state \
                and orig_state == 'stopped' \
                and state(name) != 'stopped':
            stop(name)

    if output in (None, 'all'):
        return ret
    else:
        return ret[output]
400586
synchronized void startFlusher()
  {
    // Create a new scheduled executor service with a threadfactory that
    // creates daemonized threads; this way if the user doesn't exit nicely
    // the JVM Runtime won't hang
    flusher =
        Executors.newScheduledThreadPool(1,
                                         new ThreadFactory()
                                         {
                                           @Override
                                           public Thread newThread(Runnable r)
                                           {
                                             Thread t =
                                                 Executors.defaultThreadFactory().newThread(r);
                                             t.setDaemon(true);
                                             return t;
                                           }
                                         });

    flusher.scheduleWithFixedDelay(new QueueFlusher(),
                                   0,
                                   flushPeriodMs,
                                   TimeUnit.MILLISECONDS);
  }
1105667
def start(self):
        """"""
        if self.container_id is not None:
            msg = 'The Docker container is already running with ID {}'
            raise Exception(msg.format(self.container_id))

        process = Popen(['docker ps | grep ":{}"'.format(self.port)],
                        shell=True, stdout=PIPE)
        (grep_output, _grep_error) = process.communicate()
        lines = grep_output.split('\n')
        for line in lines:
            if ':{}'.format(self.port) in line:
                other_id = line.split()[0]
                msg = 'Port {} is already being used by container {}'
                raise Exception(msg.format(self.port, other_id))

        self.container_id = check_output(self.command, shell=True).strip()
        try:
            self.ip_address = check_output(['docker-machine', 'ip']).strip()
        except (CalledProcessError, OSError):
            self.ip_address = '127.0.0.1'

        output = OutputMonitor()
        logs_process = Popen(['docker', 'logs', '-f', self.container_id],
                             stdout=output.stream.input,
                             stderr=open(os.devnull, 'w'))
        ready_log_line = 'Selenium Server is up and running'
        if not output.wait_for(ready_log_line, 10):
            logs_process.kill()
            msg = 'Timeout starting the Selenium server Docker container:\n'
            msg += '\n'.join(output.lines)
            raise Exception(msg)
        logs_process.kill()
462527
public void start() throws Throwable
   {
      if (!isExternal)
      {
         executorService = Executors.newSingleThreadExecutor(new ValidatorThreadFactory());
      }

      shutdown.set(false);
      interval = Long.MAX_VALUE;
      next = Long.MAX_VALUE;

      executorService.execute(new ConnectionValidatorRunner());
   }
1256101
public void start() {
        if (state == State.RUNNING) return;
        final Lock lock = this.lock.writeLock();
        try {
            lock.lock();
            this.state = State.STARTING;

            // Create an executor service that we'll use to start the repositories ...
            ThreadFactory threadFactory = new NamedThreadFactory("modeshape-start-repo");
            repositoryStarterService = Executors.newCachedThreadPool(threadFactory);

            state = State.RUNNING;
        } catch (RuntimeException e) {
            state = State.NOT_RUNNING;
            throw e;
        } finally {
            lock.unlock();
        }
    }
823125
@Validate
    public void start() {
        metrics.register("executors", new MetricSet() {
            @Override
            public Map<String, Metric> getMetrics() {
                return ImmutableMap.<String, Metric>of(
                        "executors.count", new Gauge<Integer>() {
                            @Override
                            public Integer getValue() {
                                return getExecutors().length;
                            }
                        },
                        "schedulers.count", new Gauge<Integer>() {

                            @Override
                            public Integer getValue() {
                                return getSchedulers().length;
                            }
                        },
                        "hung.count", new Gauge<Integer>() {

                            @Override
                            public Integer getValue() {
                                return getHungTasks();
                            }
                        },
                        "completed.count", new Gauge<Integer>() {

                            @Override
                            public Integer getValue() {
                                return getCompletedTasks();
                            }
                        }
                );
            }
        });

        for (ManagedExecutorService service : executors) {
            metrics.register(service.name(), metricsForExecutor(service));
        }

        for (ManagedExecutorService service : schedulers) {
            metrics.register(service.name(), metricsForExecutor(service));
        }
    }