The same as {@link #post(Object)} but with a delay before delivering an event
@see #post(Object)
@param what an Object to be queued
@param delay in milliseconds before delivery
973137
public static void postDelayed(Object what, long delay) {
        Handle.getInstance().mHandler.postDelayed(what, delay);
    }
748556
function delayReject(delay = 1000) {
    const begin = time();

    const promise = new Promise((resolve, reject) => {
        setTimeout(() => {
            if (promise.payload) {
                reject(promise.payload);
            }
        }, delay);
    });

    return function proceed(error) {
        // if we haven't reached the delay yet, stash the payload
        // so the setTimeout above will resolve it later
        if (time() - begin < delay) {
            promise.payload = error;
            return promise;
        }

        throw error;
    };
}
373877
@Override
    public boolean waitForIncomingEmail(long timeout, int emailCount) {
        final CountDownLatch waitObject = managers.getSmtpManager().createAndAddNewWaitObject(emailCount);
        final long endTime = System.currentTimeMillis() + timeout;
            while (waitObject.getCount() > 0) {
                final long waitTime = endTime - System.currentTimeMillis();
                if (waitTime < 0L) {
                    return waitObject.getCount() == 0;
                }
                try {
                    waitObject.await(waitTime, TimeUnit.MILLISECONDS);
                } catch (InterruptedException e) {
                    // Continue loop, in case of premature interruption
                }
            }
        return waitObject.getCount() == 0;
    }
1303100
private void processSendWork() {
        if (this.sendLink == null || this.sendLink.getLocalState() == EndpointState.CLOSED || this.sendLink.getRemoteState() == EndpointState.CLOSED) {
            if (!this.getIsClosingOrClosed()) {
                this.recreateSendLink();
            }

            return;
        }

        while (this.sendLink.getLocalState() == EndpointState.ACTIVE && this.sendLink.getRemoteState() == EndpointState.ACTIVE
                && this.sendLink.getCredit() > 0) {
            final WeightedDeliveryTag weightedDelivery;
            final ReplayableWorkItem<Void> sendData;
            final String deliveryTag;
            synchronized (this.pendingSendLock) {
                weightedDelivery = this.pendingSends.poll();
                if (weightedDelivery != null) {
                    deliveryTag = weightedDelivery.getDeliveryTag();
                    sendData = this.pendingSendsData.get(deliveryTag);
                } else {
                    sendData = null;
                    deliveryTag = null;
                }
            }

            if (sendData != null) {
                if (sendData.getWork() != null && sendData.getWork().isDone()) {
                    // CoreSend could enque Sends into PendingSends Queue and can fail the SendCompletableFuture
                    // (when It fails to schedule the ProcessSendWork on reactor Thread)
                    this.pendingSendsData.remove(deliveryTag);
                    continue;
                }

                Delivery delivery = null;
                boolean linkAdvance = false;
                int sentMsgSize = 0;
                Exception sendException = null;

                try {
                    delivery = this.sendLink.delivery(deliveryTag.getBytes(UTF_8));
                    delivery.setMessageFormat(sendData.getMessageFormat());

                    sentMsgSize = this.sendLink.send(sendData.getMessage(), 0, sendData.getEncodedMessageSize());
                    assert sentMsgSize == sendData.getEncodedMessageSize() : "Contract of the ProtonJ library for Sender.Send API changed";

                    linkAdvance = this.sendLink.advance();
                } catch (Exception exception) {
                    sendException = exception;
                }

                if (linkAdvance) {
                    sendData.setWaitingForAck();
                } else {
                    if (TRACE_LOGGER.isDebugEnabled()) {
                        TRACE_LOGGER.debug(
                                String.format(Locale.US, "clientId[%s], path[%s], linkName[%s], deliveryTag[%s], sentMessageSize[%s], payloadActualSize[%s] - sendlink advance failed",
                                        this.getClientId(), this.sendPath, this.getSendLinkName(), deliveryTag, sentMsgSize, sendData.getEncodedMessageSize()));
                    }

                    if (delivery != null) {
                        delivery.free();
                    }

                    sendData.getWork().completeExceptionally(sendException != null
                            ? new OperationCancelledException(String.format(Locale.US,
                            "Entity(%s): send operation failed. Please see cause for more details", this.sendPath), sendException)
                            : new OperationCancelledException(
                            String.format(Locale.US, "Entity(%s): send operation failed while advancing delivery(tag: %s).", this.sendPath, deliveryTag)));
                }
            } else {
                if (deliveryTag != null) {
                    if (TRACE_LOGGER.isDebugEnabled()) {
                        TRACE_LOGGER.debug(
                                String.format(Locale.US, "clientId[%s], path[%s], linkName[%s], deliveryTag[%s] - sendData not found for this delivery.",
                                        this.getClientId(), this.sendPath, this.getSendLinkName(), deliveryTag));
                    }
                }

                break;
            }
        }
    }
456966
@RobotKeywordOverload
    @ArgumentNames({ "topic", "message" })
    public void publishToMQTTSynchronously(String topic, Object message)
            throws MqttException {
        publishToMQTTSynchronously(topic, message, 0, false);
    }
513263
public void scheduleBlockReport(long delay) {
    if (delay > 0) { // send BR after random delay
      lastBlockReport = System.currentTimeMillis()
                            - ( anode.blockReportInterval - R.nextInt((int)(delay)));
    } else { // send at next heartbeat
      lastBlockReport = lastHeartbeat - anode.blockReportInterval;
    }
    resetBlockReportTime = true; // reset future BRs for randomness
  }
744239
def wait(self, delay):
        
        for _ in range(0, delay):
            self._add_step((self._rec_x, self._rec_y))
1101879
protected void doPublish(String tenantId, List<T> items, String subscriber,
            int retryCount, long delay) throws Exception {
        String data = mapper.writeValueAsString(items);

        TextMessage tm = session.createTextMessage(data);

        if (tenantId != null) {
            tm.setStringProperty("tenant", tenantId);
        }

        if (subscriber != null) {
            tm.setStringProperty("subscriber", subscriber);
        }

        tm.setIntProperty("retryCount", retryCount);

        if (delay > 0) {
            tm.setLongProperty("_AMQ_SCHED_DELIVERY", System.currentTimeMillis() + delay);
        }

        if (log.isLoggable(Level.FINEST)) {
            log.finest("Publish: " + tm);
        }

        producer.send(tm);
    }
303268
@Override
  public void send(T value, Result<Void> result)
  {
    /*
    if (! init() && pendingSend(value, result)) {
      return;
    }
    */
    
    send(value);

    result.ok(null);
  }
1310946
@Override
	public void postDelayed(Object event, long delayMillis) {
		if (event == null) {
			throw new NullPointerException("Event must not be null");
		}
        Handler handler = getMainHandlerNotNull();
        if (handler.getLooper().getThread().isAlive()) {
		    mImpl.postDelayed(event, delayMillis, handler);
        } // otherwise the bus is already stopped
	}
502158
@Override
	public final void send(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
    {
    	if (this.destination == null)
    		throw new UnsupportedOperationException("Destination was not set at creation time");

        // Setup message fields
    	setupMessage(destination,message,deliveryMode,priority,timeToLive);
    	
    	// Handle foreign message implementations
        message = MessageTools.normalize(message);
        
    	sendToDestination(destination,false,message,deliveryMode,priority,timeToLive);
    }
713745
@Override
    protected void beforeWaitForSynchronization(final T message) throws CouldNotPerformException {
        transactionIdField = ProtoBufFieldProcessor.getFieldDescriptor(message, TransactionIdProvider.TRANSACTION_ID_FIELD_NAME);
        if (transactionIdField == null) {
            throw new NotAvailableException("transaction id field for message[" + message.getClass().getSimpleName() + "]");
        }

        if (transactionIdField.getType() != Type.UINT64) {
            throw new CouldNotPerformException("Transaction id field of message[" + message.getClass().getSimpleName() + "] has an unexpected type[" + transactionIdField.getType().name() + "]");
        }
    }
548731
def _delay(self, ms):
        
        if ms:
            self.Delay(ms)
        else:
            if self.default_delay:
                self.Delay(self.default_delay)
270814
public Response post(Object object) {
        assertNotEmpty(object, "object");
        InputStream response = null;
        try {
            response = couchDbClient.post(new DatabaseURIHelper(dbUri).getDatabaseUri(),
                    getGson().toJson(object));
            return getResponse(response, Response.class, getGson());
        } finally {
            close(response);
        }
    }
308682
public static String doPost(String url, Map<String, String> params, int connectTimeout, int readTimeout) throws IOException {
        return doPost(url, params, DEFAULT_CHARSET, connectTimeout, readTimeout);
    }
1111879
public static String doPost(String url, Map<String, String> params, String charset, int connectTimeout, int readTimeout) throws IOException {
        return doPost(url, params, charset, connectTimeout, readTimeout, null);
    }
339477
public static Command delay (final Command command, final int delay)
    {
        return (command == null) ? null : new Command() {
            public void execute () {
                new Timer() {
                    @Override public void run () {
                        command.execute();
                    }
                }.schedule(delay);
            }
        };
    }