start async client
199931
public function start()
    {
        foreach ($this->callbacks as $event => $callback) {
            $this->client->on($event, $callback);
        }
        $this->connect();
    }
636242
def connect_async(self, conn_id, connection_string, callback):
        """"""

        future = self._loop.launch_coroutine(self._adapter.connect(conn_id, connection_string))
        future.add_done_callback(lambda x: self._callback_future(conn_id, x, callback))
1020271
async def run_async(self, endpoint: str):
        
        self._connect(endpoint)

        # spawn an initial listen task
        listen_task = asyncio.ensure_future(self._socket.recv_multipart())
        task_list = [listen_task]

        while True:
            dones, pendings = await asyncio.wait(task_list, return_when=asyncio.FIRST_COMPLETED)

            # grab one "done" task to handle
            task_list, done_list = list(pendings), list(dones)
            done = done_list.pop()
            task_list += done_list

            if done == listen_task:
                try:
                    # empty_frame may either be:
                    # 1. a single null frame if the client is a REQ socket
                    # 2. an empty list (ie. no frames) if the client is a DEALER socket
                    identity, *empty_frame, msg = done.result()
                    request = from_msgpack(msg)

                    # spawn a processing task
                    task_list.append(asyncio.ensure_future(
                        self._process_request(identity, empty_frame, request)))
                except Exception as e:
                    if self.serialize_exceptions:
                        _log.exception('Exception thrown in Server run loop during request '
                                       'reception: {}'.format(str(e)))
                    else:
                        raise e
                finally:
                    # spawn a new listen task
                    listen_task = asyncio.ensure_future(self._socket.recv_multipart())
                    task_list.append(listen_task)
            else:
                # if there's been an exception during processing, consider reraising it
                try:
                    done.result()
                except Exception as e:
                    if self.serialize_exceptions:
                        _log.exception('Exception thrown in Server run loop during request '
                                       'dispatch: {}'.format(str(e)))
                    else:
                        raise e
1233622
def client_start(request, socket, context):
    
    CLIENTS[socket.session.session_id] = (request, socket, context)
376443
async def start(self):
        """"""

        while True:
            try:
                data = await self.reader.read(8192)

                if self._trace_enabled:
                    self._logger.trace(
                        "Received %d bytes from remote server:\n%s",
                        len(data),
                        msg.dump(data),
                    )
                await self.process(data)
            except asyncio.CancelledError:
                return
            except:
                logging.exception("Unhandled error in Message Reader")
                raise
1312583
function start(options, callback) {
  const args = utils.getArgs(options, [config], callback);

  app.set("config", args.options);
  server.listen(args.options.port, args.options.ip, function() {
    return args.callback(null);
  }).on("error", function(err) {
    if (err.code === "EADDRINUSE") {
      return args.callback(err);
    }
    console.error(err);
  });
}
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))
468013
def start(self):
        """"""
        asyncio.ensure_future(self.register(), loop=self._event_loop)

        if self._own_loop:
            _LOGGER.info("Starting up our own event loop.")
            self._event_loop.run_forever()
            self._event_loop.close()
            _LOGGER.info("Connection shut down.")
62872
def start(self):
        """"""
        if not self.pipe is None:
            raise RuntimeError("Cannot start task twice")

        self.ioloop = tornado.ioloop.IOLoop.instance()
        if self.timeout > 0:
            self.expiration = self.ioloop.add_timeout( time.time() + self.timeout, self.on_timeout )
        self.pipe = subprocess.Popen(**self.args)

        self.streams = [ (self.pipe.stdout.fileno(), []),
                         (self.pipe.stderr.fileno(), []) ]
        for fd, d in self.streams:
            flags = fcntl.fcntl(fd, fcntl.F_GETFL)| os.O_NDELAY
            fcntl.fcntl( fd, fcntl.F_SETFL, flags)
            self.ioloop.add_handler( fd,
                                     self.stat,
                                     self.ioloop.READ|self.ioloop.ERROR)
948377
def startService(self):
        
        self.clientFactory.connect().addErrback(
            log.err, 'error starting the JSON-RPC client service %r' % (self,))
        service.Service.startService(self)
874997
@Override
    public AsyncContext startAsync() {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.startAsync();
        } finally {
            collaborator.postInvoke();
        }
    }
558392
async def start_async(self):
        
        if self.run_task:
            raise Exception("A PartitionManager cannot be started multiple times.")

        partition_count = await self.initialize_stores_async()
        _logger.info("%r PartitionCount: %r", self.host.guid, partition_count)
        self.run_task = asyncio.ensure_future(self.run_async())
877245
public void start() {
        if(actionInBackground != null) {

            Runnable jobToRun = new Runnable() {
                @Override
                public void run() {
                    result = (JobResult) actionInBackground.doAsync();
                    onResult();
                }
            };

            if(getExecutorService() != null) {
               asyncFutureTask = (FutureTask) getExecutorService().submit(jobToRun);
            } else {
                asyncThread = new Thread(jobToRun);
                asyncThread.start();
            }
        }
    }
1302771
def start(self):
        """"""
        yield from self._do_connect()
        _LOGGER.info('connected to snapserver on %s:%s', self._host, self._port)
        status = yield from self.status()
        self.synchronize(status)
        self._on_server_connect()
901880
async def start(self):
        """"""

        self._command_task.start()

        try:
            await self._cleanup_old_connections()
        except Exception:
            await self.stop()
            raise

        #FIXME: This is a temporary hack, get the actual device we are serving.
        iotile_id = next(iter(self.adapter.devices))
        self.device = self.adapter.devices[iotile_id]

        self._logger.info("Serving device 0x%04X over BLED112", iotile_id)
        await self._update_advertisement()

        self.setup_client(self.CLIENT_ID, scan=False, broadcast=True)
675369
public final AsyncWork<T, Exception> start() {
		AsyncWork<T, Exception> result = new AsyncWork<>();
		resume(result);
		return result;
	}
1326703
public void start() {
        setStatus(ConnectionStatus.NOT_CONNECTED);
        InetSocketAddress address = directoryServer;
        clientSocket.connect(address);
        eventThread.start();
        connectionThread = new Thread(new ConnectTask());
        connectionThread.setDaemon(true);
        connectionThread.setName(ServiceDirectoryThread.getThreadName("Client_Connect_Thread"));
        connectionThread.start();
    }