Setup remote Pulsar server to run this job.
966988
def setup(self, tool_id=None, tool_version=None, preserve_galaxy_python_environment=None):
        
        setup_args = {"job_id": self.job_id}
        if tool_id:
            setup_args["tool_id"] = tool_id
        if tool_version:
            setup_args["tool_version"] = tool_version
        if preserve_galaxy_python_environment:
            setup_args["preserve_galaxy_python_environment"] = preserve_galaxy_python_environment
        return self.setup_handler.setup(**setup_args)
561966
def setup_server(config_path):
    """"""
    # configure the SharQ server
    server = SharQServer(config_path)
    # start the requeue loop
    gevent.spawn(server.requeue)

    return server
151931
def runserver(hostname, port, no_reloader, debugger, no_evalex, threaded, processes):
    """"""
    app = make_app()
    reloader = not no_reloader
    evalex = not no_evalex
    run_simple(
        hostname,
        port,
        app,
        use_reloader=reloader,
        use_debugger=debugger,
        use_evalex=evalex,
        threaded=threaded,
        processes=processes,
    )
1130938
function main() {
  var server = new grpc.Server();
  server.addService(services.GreeterService, {sayHello: sayHello});
  server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
  server.start();
}
158761
def deploy(verbose, app):
    """"""
    # Load psiTurk configuration.
    config = PsiturkConfig()
    config.load_config()

    # Set the mode.
    config.set("Experiment Configuration", "mode", "deploy")
    config.set("Server Parameters", "logfile", "-")

    # Ensure that psiTurk is not in sandbox mode.
    config.set("Shell Parameters", "launch_in_sandbox_mode", "false")

    # Do shared setup.
    deploy_sandbox_shared_setup(verbose=verbose, app=app)
32250
def setup(self):
        ''''''
        TelnetHandlerBase.setup(self)
        # Spawn a thread to handle socket input
        self.thread_ic = threading.Thread(target=self.inputcooker)
        self.thread_ic.setDaemon(True)
        self.thread_ic.start()
        # Note that inputcooker exits on EOF
        
        # Sleep for 0.5 second to allow options negotiation
        time.sleep(0.5)
931900
def run_server(server)
      grpc_server = server.server

      t = Thread.new { grpc_server.run }
      grpc_server.wait_till_running

      begin
        yield
      ensure
        grpc_server.stop
        sleep(0.1) until grpc_server.stopped?
        t.join
      end
    end
1270780
def setup_rpc(self):
        """"""

        endpoints = RpcCallBacks(self._vdpm, self._iptd)
        self.server = rpc.DfaRpcServer(self._qn, self._my_host, self._url,
                                       endpoints,
                                       exchange=constants.DFA_EXCHANGE)
484191
def run(self):
        ''''''
        # Register our signal handlers
        self.signals()

        with self.listener():
            for job in self.jobs():
                # If there was no job to be had, we should sleep a little bit
                if not job:
                    self.jid = None
                    self.title('Sleeping for %fs' % self.interval)
                    time.sleep(self.interval)
                else:
                    self.jid = job.jid
                    self.title('Working on %s (%s)' % (job.jid, job.klass_name))
                    with Worker.sandbox(self.sandbox):
                        job.sandbox = self.sandbox
                        job.process()
                if self.shutdown:
                    break
221152
function setup() {
    primus.streams = {};

    for (var event in primus.reserved.events) {
      if ('data' === event) continue;

      primus.on(event, listen(event));
    }
  }
1007631
def run(self):
        """"""
        event_handler = Handler()
        threads = []
        paths = [os.path.join(cwd, "content"), os.path.join(cwd, "templates")]

        for i in paths:
            targetPath = str(i)
            self.observer.schedule(event_handler, targetPath, recursive=True)
            threads.append(self.observer)

        self.observer.start()

        try:
            while True:
                time.sleep(5)
        except:
            self.observer.stop()
            print("\nObserver stopped.")

        self.observer.join()
1328742
def _setup_pailgun(self):
    """"""
    # Constructs and returns a runnable PantsRunner.
    def runner_factory(sock, arguments, environment):
      return self._runner_class.create(
        sock,
        arguments,
        environment,
        self.services,
        self._scheduler_service,
      )

    # Plumb the daemon's lifecycle lock to the `PailgunServer` to safeguard teardown.
    # This indirection exists to allow the server to be created before PantsService.setup
    # has been called to actually initialize the `services` field.
    @contextmanager
    def lifecycle_lock():
      with self.services.lifecycle_lock:
        yield

    return PailgunServer(self._bind_addr, runner_factory, lifecycle_lock, self._request_complete_callback)
261863
def run(self):
        """"""
        (task_id, tasks) = self.server.get_task()
        self.task_store.from_dict(tasks)
        for (index, task) in self.task_store:
            result = self.compute(index, task)
            self.results.append(result)
        self.server.task_done((task_id, self.results))
901644
def start_http_server(port, addr='', registry=REGISTRY):
    """"""
    CustomMetricsHandler = MetricsHandler.factory(registry)
    httpd = _ThreadingSimpleServer((addr, port), CustomMetricsHandler)
    t = threading.Thread(target=httpd.serve_forever)
    t.daemon = True
    t.start()
811764
def _start_server(bindaddr, port, hostname, folder):
    """"""
    import asyncio
    from .httpserver import HttpProtocol
    loop = asyncio.get_event_loop()
    coroutine = loop.create_server(lambda: HttpProtocol(hostname, folder),
                                   bindaddr,
                                   port)
    server = loop.run_until_complete(coroutine)

    print('Starting server on {}'.format(server.sockets[0].getsockname()))
    try:
        loop.run_forever()
    except KeyboardInterrupt:
        pass
345803
def configure
      @web_server.mount('/alive', Alive)
      @web_server.mount('/tasks/new', NewTask, self)
      @web_server.mount('/shutdown', Shutdown)
      @web_server.mount('/response_from_device', ResponseFromDevice, self)
      @web_server.mount('/auto_update_pid', AutoUpdatePID, self)
    end
348100
def work():
    """"""
    with rq.Connection(create_connection()):
        worker = rq.Worker(list(map(rq.Queue, listen)))
        worker.work()