Wait for RPC request to arrive.

        :param str uuid: Rpc Identifier.
        :param obj connection_adapter: Provide custom connection adapter.
        :return:
163089
def _wait_for_request(self, uuid, connection_adapter=None):
        
        start_time = time.time()
        while not self._response[uuid]:
            connection_adapter.check_for_errors()
            if time.time() - start_time > self._timeout:
                self._raise_rpc_timeout_error(uuid)
            time.sleep(IDLE_WAIT)
240775
def wait_for_net(self, timeout=None, wait_polling_interval=None):
        
        if timeout is None:
            timeout = self._timeout
        if wait_polling_interval is None:
            wait_polling_interval = self._wait_polling_interval

        self._logger.info("Waiting for network connection")
        poll_wait(self.get_ip_address, timeout=timeout)
100874
def _on_connection(self, data, unique_id):
        
        if unique_id is None:
            unique_id = self.stream_unique_id
        self.connection_id = data.get('connectionId')
        logger.info('[Connect: %s]: connection_id: %s' % (unique_id, self.connection_id))
1336226
def _connectRelay(self, process, protocolFactory):
        
        try:
            wf = _WrappingFactory(protocolFactory)
            connector = RelayConnector(process, wf, self.timeout,
                                       self.inductor.reactor)
            connector.connect()
        except:
            return defer.fail()
        # Return a deferred that is called back when the protocol is connected.
        return wf._onConnection
1062471
def wait_for_net_service(server, port, timeout=None, poll_interval=0.1):
    
    import socket
    import errno

    s = socket.socket()
    if timeout:
        from time import time as now
        # time module is needed to calc timeout shared between two exceptions
        end = now() + timeout

    while True:
        try:
            if timeout:
                next_timeout = end - now()
                if next_timeout < 0:
                    return False
                else:
                    s.settimeout(next_timeout)

            s.connect((server, port))

        except socket.timeout as err:
            # this exception occurs only if timeout is set
            if timeout:
                return False

        except Exception as err:
            # catch timeout exception from underlying network library
            # this one is different from socket.timeout
            if not isinstance(err.args, tuple) or err.args[0] != errno.ETIMEDOUT:
                pass  # raise
        else:
            s.close()
            return True
        time.sleep(poll_interval)
1364004
def get(self, id):
        
        with rconnect() as conn:
            if id is None:
                raise ValueError

            if isinstance(id, uuid.UUID):
                id = str(id)

            if type(id) != str and type(id) != unicode:
                raise ValueError

            try:
                query = self._base().get(id)
                log.debug(query)
                rv = query.run(conn)
            except ReqlOpFailedError as e:
                log.warn(e)
                raise
            except Exception as e:
                log.warn(e)
                raise
            if rv is not None:
                return self._model(rv)

            return None
305693
def wait_for_connection(self, timeout=10):
        
        start_time = datetime.datetime.now()
        while True:
            if self.connected:
                return True
            now = datetime.datetime.now()
            if (now - start_time).total_seconds() > timeout:
                return False
            time.sleep(0.5)
829411
def _wait_for_connection_state(self, state=Stateful.OPEN, rpc_timeout=30):
        
        start_time = time.time()
        while self.current_state != state:
            self.check_for_errors()
            if time.time() - start_time > rpc_timeout:
                raise AMQPConnectionError('Connection timed out')
            sleep(IDLE_WAIT)
179626
def wait_return(self, callback):
        """"""
        if self.check_recv():
            return callback(self)
        _t = threading.Thread(target=self._wait_non_ressources, args=(callback,))  # noqa: E501
        _t.setDaemon(True)
        _t.start()
1122126
def _waitForIP(cls, instance):
        
        logger.debug('Waiting for ip...')
        while True:
            time.sleep(a_short_time)
            instance.update()
            if instance.ip_address or instance.public_dns_name or instance.private_ip_address:
                logger.debug('...got ip')
                break
102617
@Override
    public void connectAsynch(Object _udpRequestContextObject) {
        try {
            connectCommon(_udpRequestContextObject);
            getApplicationCallback().ready(vc);
        } catch (IOException e) {
            getApplicationCallback().destroy(e);
        }
    }
815671
def connect(self, addr):
        """"""
        if _debug: RouterToRouterService._debug("connect %r", addr)

        # make a connection
        conn = ConnectionState(addr)
        self.multiplexer.connections[addr] = conn

        # associate with this service, but it is not connected until the ack comes back
        conn.service = self

        # keep a list of pending NPDU objects until the ack comes back
        conn.pendingNPDU = []

        # build a service request
        request = ServiceRequest(ROUTER_TO_ROUTER_SERVICE_ID)
        request.pduDestination = addr

        # send it
        self.service_request(request)

        # return the connection object
        return conn
279795
def wait(self):
        
        if self.error:
            raise self.error
        if not self.running:
            raise ValueError("Unable to send until client has been started.")
        try:
            self._handler.wait()
        except (errors.TokenExpired, errors.AuthenticationException):
            log.info("Sender disconnected due to token error. Attempting reconnect.")
            self.reconnect()
        except (errors.LinkDetach, errors.ConnectionClose) as shutdown:
            if shutdown.action.retry and self.auto_reconnect:
                log.info("Sender detached. Attempting reconnect.")
                self.reconnect()
            else:
                log.info("Sender detached. Shutting down.")
                error = EventHubError(str(shutdown), shutdown)
                self.close(exception=error)
                raise error
        except errors.MessageHandlerError as shutdown:
            if self.auto_reconnect:
                log.info("Sender detached. Attempting reconnect.")
                self.reconnect()
            else:
                log.info("Sender detached. Shutting down.")
                error = EventHubError(str(shutdown), shutdown)
                self.close(exception=error)
                raise error
        except Exception as e:
            log.info("Unexpected error occurred (%r).", e)
            raise EventHubError("Send failed: {}".format(e))
918673
def _send_and_wait(self, **kwargs):
        
        frame_id = self.next_frame_id
        kwargs.update(dict(frame_id=frame_id))
        self._send(**kwargs)
        timeout = datetime.now() + const.RX_TIMEOUT
        while datetime.now() < timeout:
            try:
                frame = self._rx_frames.pop(frame_id)
                raise_if_error(frame)
                return frame
            except KeyError:
                sleep(0.1)
                continue
        _LOGGER.exception(
            "Did not receive response within configured timeout period.")
        raise exceptions.ZigBeeResponseTimeout()
1267478
def wait_for_instance(instance):
    

    status = None
    print("getting status for instance {} ...".format(instance.id))
    while status is None:
        try:
            status = instance.update()
            if status is None:
                time.sleep(2)
        except EC2ResponseError:
            time.sleep(2)

    print("waiting for instance {} ...".format(instance.id))

    while status == "pending":
        time.sleep(2)
        status = instance.update()

    if status != "running":
        print("Invalid status when starting instance {}: {}".format(instance.id, status))
        return False

    print("New instance {} started: {}".format(instance.id, instance.ip_address))
    return True
714789
function (timeout, hash, uuid) {
    this.actionQueue.push(this.webdriverClient.implicitWait.bind(this.webdriverClient, timeout));
    this.actionQueue.push(this._waitCb.bind(this, timeout, hash, uuid));
    return this;
  }
1245442
def wait(timeout = SimCtl.default_timeout)
      Timeout.timeout(timeout) do
        loop do
          break if yield SimCtl.device(udid: udid)
        end
      end
      reload
    end