Run runnable repeatedly with the given delay between calls. Exceptions are
caught and logged as errors.
506924
public static void scheduleWithFixedDelay(ScheduledExecutorService exec, Duration delay, Runnable runnable)
  {
    scheduleWithFixedDelay(exec, delay, delay, runnable);
  }
465156
public PeriodicEvent runAfter(Runnable task, float delay) {
        validateDelay(delay);
        return new Event(task, delay);
    }
1204988
private void scheduleReconnection() {

        if (runnable != null) {
            handler.removeCallbacks(runnable);
        }

        runnable = () -> {
            if (shouldReconnect() && (socket == null || !socket.isOpen()) && retryStrategy.retry() && !isNetworkUnavailable) {
                log.d("Reconnecting socket");
                connect();
            }
        };
        long delay = retryStrategy.getDelay();
        handler.postDelayed(runnable, delay);
        log.d("Socket reconnection in " + delay / 1000 + " seconds.");
    }
333172
void waitRun(long waitMillis, int waitNanos, boolean cancelOnTimeOut) {
        if (!mDone) {
            synchronized (this) {
                if (!mDone) {
                    try {
                        this.wait(waitMillis, waitNanos);
                    } catch (InterruptedException ignored) {
                    } finally {
                        if (!mDone && cancelOnTimeOut)
                            mDone = true;
                    }
                }
            }
        }
    }
1043563
@Override
  public void run()
  {
    try {
      runImpl();
    } catch (final Throwable e) {
      // env/0203 vs env/0206
      if (e instanceof DisplayableException)
        log.warning(e.getMessage());
      else
        log.warning(e.toString());
      
      _exception = e;
    } finally {
      notifyComplete();
    }
  }
34304
public static ScheduledFuture<?> runWithSchedule(long delayMillis,
            Runnable runnable) {
        return newSingleScheduledThreadPool()
                .schedule(
                        buildRunnableWithLogging("runWithSchedule", runnable,
                                delayMillis),
                        delayMillis, TimeUnit.MILLISECONDS);
    }
1173230
@Override
  public void run() {
    synchronized (lock) {
      if (!callables.hasNext()) {
        checkEnd();
        return;
      }

      for (int i = 0; i < parallelism && callables.hasNext(); i++) {
        setupNext(callables.next());
      }
    }

    future.whenCancelled(() -> {
      cancel = true;
      checkNext();
    });
  }
85148
public static ScheduledFuture<?> runWithScheduleWithFixedDelay(
            long initialDelayMillis, long delayMillis, Runnable runnable) {
        return runWithScheduleWithFixedDelay(initialDelayMillis, delayMillis,
                "runWithScheduleWithFixedDelay", runnable);
    }
76937
public static void invokeOnEventDispatchThread(Runnable runnable)
    {
        if (SwingUtilities.isEventDispatchThread())
        {
            runnable.run();
        }
        else
        {
            SwingUtilities.invokeLater(runnable);
        }
    }
642816
public void schedulePrune(long delay) {
		this.pruneJobFuture = GlobalPruneTimer.INSTANCE.schedule(new Runnable() {
			@Override
			public void run() {
				prune();
			}
		}, delay);
	}
60441
def runAndWait(self):
        '''
        
        '''
        self._push(self._engine.endLoop, tuple())
        self._driver.startLoop()
512672
def run(self, *, delay=None):
        
        self.broker.enqueue(self.messages[0], delay=delay)
        return self
278149
def iterate(self, delay=None):
        
        self.runUntilCurrent()
        self.doEvents()
        self.doIteration(delay)
1331044
public void invoke(Runnable r) throws Exception {
        try {
            r.run();
            succeed();
        } catch (Exception e) {
            fail();
            throw e;
        }
    }
422854
public void run() {
        Runnable r = null;
        while (true) {
            // Try to drain the maximum capacity of thread-local items, checking
            // whether any were available
            if (workQueue.drainTo(internalQueue, threadLocalItems) == 0) {
                // block until a work item is available
                try {
                    internalQueue.offer(workQueue.take());
                } catch (InterruptedException ie) {
                    throw new Error(ie);
                }
            }
            // Execute all of the thread-local items
            while ((r = internalQueue.poll()) != null)
                r.run();
        }
    }
74089
@Override
    public void run() {

        boolean runOnce = (m_runnable != null);

        while (m_run) {
            setPriority(m_pool.getThreadPriority());
            try {
                if (m_runnable == null) {
                    m_runnable = m_pool.getNextRunnable();
                }

                if (m_runnable != null) {
                    m_runnable.run();
                }
            } catch (InterruptedException e) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_THREAD_INTERRUPTED_1, getName()), e);
            } catch (Throwable t) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_THREAD_ERROR_1, getName()), t);
            } finally {
                if (runOnce) {
                    m_run = false;
                }
                m_runnable = null;
            }
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_THREAD_SHUTDOWN_1, getName()));
        }
    }
104203
protected void start() {
        // if a periodic execution throws an exception, future executions are suspended,
        // this task wraps the call in a try-catch block to prevent that. Errors are still propagated.
        final Runnable resilientTask = () -> {
            try {
                run();
            } catch (final Exception e) {
                logger.error("[{}] Error during timeout-initiated flush", name, e);
            }
        };

        scheduler.scheduleAtFixedRate(resilientTask, 0, batchTimeout + salt, TimeUnit.MILLISECONDS);
    }