Implements synchronous sending of "simple" actions.

@param timeout - in milliseconds
509137
public ManagerResponse sendAction(ManagerAction action, long timeout)
            throws IOException, TimeoutException, IllegalArgumentException, IllegalStateException
    {
        ResponseHandlerResult result = new ResponseHandlerResult();
        SendActionCallback callbackHandler = new DefaultSendActionCallback(result);

        sendAction(action, callbackHandler);

        // definitely return null for the response of user events
        if (action instanceof UserEventAction)
        {
            return null;
        }

        // only wait if we did not yet receive the response.
        // Responses may be returned really fast.
        if (result.getResponse() == null)
        {
            try
            {
                result.await(timeout);
            }
            catch (InterruptedException ex)
            {
                logger.warn("Interrupted while waiting for result");
                Thread.currentThread().interrupt();
            }
        }

        // still no response?
        if (result.getResponse() == null)
        {
            throw new TimeoutException("Timeout waiting for response to " + action.getAction()
                    + (action.getActionId() == null ? "" : " (actionId: " + action.getActionId() + ")"));
        }

        return result.getResponse();
    }
1035380
public void processTimeout(TimeoutEvent arg0) {
    synchronized (listeners) {
      Iterator<SipListener> iter = listeners.iterator();
      while (iter.hasNext() == true) {
        SipListener listener = (SipListener) iter.next();
        listener.processTimeout(arg0);
      }
    }
  }
1263305
function (i) {
    robot.adapter.send(data.context, messages_to_send[i]);

    if (messages_to_send.length > ++i) {
      setTimeout(function () { sendMessage(i); }, 300);
    }
  }
570852
public void callWithTimeout(String description, int timeout, Runnable task) {
        Future<?> callFuture = threadPool.submit(task);
        getWithTimeout(callFuture, timeout, description);
    }
960665
final void internalWait(long timeout) {
    int s;
    if ((s = status) >= 0 && // force completer to issue notify
        U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
      synchronized (this) {
        if (status >= 0)
          try {
            wait(timeout);
          } catch (InterruptedException ie) {
          }
        else
          notifyAll();
      }
    }
  }
113529
public void setTimeout(Duration timeout) {

        LettuceAssert.notNull(timeout, "Timeout must not be null");
        LettuceAssert.isTrue(!timeout.isNegative(), "Timeout must be greater or equal 0");

        this.timeout = timeout;
    }
1002359
@Override
  public void send(final CharSequence text) {
    final KeyCharacterMap characterMap = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD);

    long timeout =
        System.currentTimeMillis()
            + serverInstrumentation.getAndroidWait().getTimeoutInMillis();
    SelendroidLogger.info("Using timeout of " + timeout + " milli seconds.");

    done = false;

    instrumentation.runOnMainSync(new Runnable() {
      public void run() {
        for (int i = 0; i < text.length(); i++) {
          char c = text.charAt(i);
          int code = WebViewKeys.getKeyEventFromUnicodeKey(c);
          if (code != -1) {
            webview.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, code));
            webview.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, code));
          } else {
            KeyEvent[] arr = characterMap.getEvents(new char[] {c});
            if (arr != null) {
              for (int j = 0; j < arr.length; j++) {
                webview.dispatchKeyEvent(arr[j]);
              }
            }
          }
        }
        done = true;
      }
    });
  }
993624
public void setConnectTimeout(long connectTimeout, TimeUnit unit) {
        this.connectTimeout = Duration.ofMillis(unit.toMillis(connectTimeout));
    }
1246572
public void setSessionTimeout(Long timeout, TimeUnit unit) {
        long t = unit.toMillis(timeout);
        properties.put("request.timeout.ms", String.valueOf(t + 60000));
        properties.put("session.timeout.ms", String.valueOf(t));
    }
145009
public static Function<RSocket, RSocket> timeout(Duration timeout) {
    return source ->
        new RSocketProxy(source) {
          @Override
          public Mono<Void> fireAndForget(Payload payload) {
            return source.fireAndForget(payload).timeout(timeout);
          }

          @Override
          public Mono<Payload> requestResponse(Payload payload) {
            return source.requestResponse(payload).timeout(timeout);
          }

          @Override
          public Flux<Payload> requestStream(Payload payload) {
            return source.requestStream(payload).timeout(timeout);
          }

          @Override
          public Flux<Payload> requestChannel(Publisher<Payload> payloads) {
            return source.requestChannel(payloads).timeout(timeout);
          }

          @Override
          public Mono<Void> metadataPush(Payload payload) {
            return source.metadataPush(payload).timeout(timeout);
          }
        };
  }
360213
public static Timer setTimeout(int milliseconds, TimerCallback callback) {
		TimeoutTimer timeout = new TimeoutTimer(); 
		timeout.setId(nativeSetTimeout(milliseconds, callback, timeout));
		return timeout;
	}
884771
function(client, window, timeoutSeconds, action, args) {
      this._window = window;
      if (!timeoutSeconds)
        timeoutSeconds = 30;

      var doTimeout = function (action, client, args) {
        return function () {
          return action.apply(client, args);
        };
      };
      this.timeout = setTimeout(doTimeout(action, client, args), timeoutSeconds * 1000);

      this.cancel = function() {
        this._window.clearTimeout(this.timeout);
      };
    }
411559
public static Timeout min(Timeout... timeouts)
	{
		Timeout min = null;

		for (Timeout timeout : timeouts)
		{
			if (timeout != null)
				if (min == null || min.getMilliseconds() > timeout.getMilliseconds())
					min = timeout;
		}

		if (min != null)
			return min;
		else
			throw new IllegalArgumentException("Must specify at least one non-null timeout!");
	}
947805
public void setTimeout(Duration timeout) {

        LettuceAssert.notNull(timeout, "Timeout duration must not be null");
        LettuceAssert.isTrue(!timeout.isNegative(), "Timeout duration must be greater or equal to zero");

        this.timeout = timeout;

        if (channelWriter instanceof CommandExpiryWriter) {
            ((CommandExpiryWriter) channelWriter).setTimeout(timeout);
        }
    }
577051
public void executeAsyncTimed(final long timeout) {
		if (executeThread != null) {
			throw new IllegalStateException("use executable once per call");
		}
		final Executable nestedExec = this;
		helperExecutable = new Executable() {
			public Object execute() throws Throwable {
				return nestedExec.executeTimed(timeout);
			}
		};
		helperExecutable.executeAsync();
	}
241935
public SdkClientBuilder connectionCheckoutTimeout(long timeout, TimeUnit unit)
    {
        this.connectionCheckoutTimeoutMs = (int) TimeUnit.MILLISECONDS.convert(timeout, unit);
        return this;
    }
874153
function () {
    clearTimeout(timeoutId);
    var args = [];
    for (var index = 0, length = arguments.length; index < length; index++) {
      args.push(arguments[index]);
    }
    self.socketEvent = {
      namespace: action.namespace,
      eventType: action.eventType,
      args: args
    };
    callback(null, self.socketEvent);
  }