public static class SwtExec.Blocking extends SwtExec
SwtExec.blocking()
) which adds a blocking get()
method.
execute(Runnable)
is called from the SWT thread, the Runnable
will be executed immediately.Runnable
will be passed to Display.syncExec
.SwtExec.blocking
SwtExec.Blocking, SwtExec.Guarded
display, rxExecutor, scheduler
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable runnable)
Executes the given command at some time in the future.
|
<T> T |
get(Supplier<T> supplier)
Performs a blocking get in the UI thread.
|
<V> ScheduledFuture<V> |
schedule(Callable<V> callable,
long delay,
TimeUnit unit)
Creates and executes a ScheduledFuture that becomes enabled after the
given delay.
|
ScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled
after the given delay.
|
ScheduledFuture<?> |
scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the given
period; that is executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on.
|
ScheduledFuture<?> |
scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first
after the given initial delay, and subsequently with the
given delay between the termination of one execution and the
commencement of the next.
|
async, awaitTermination, blocking, getRxExecutor, getRxScheduler, guardOn, guardOn, immediate, isShutdown, isTerminated, shutdown, shutdownNow, timerExec
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
public void execute(Runnable runnable)
SwtExec
public <T> T get(Supplier<T> supplier)
supplier
- will be executed in the UI thread.public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
SwtExec
schedule
in interface ScheduledExecutorService
schedule
in class SwtExec
command
- the task to executedelay
- the time from now to delay executionunit
- the time unit of the delay parameterpublic <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)
SwtExec
schedule
in interface ScheduledExecutorService
schedule
in class SwtExec
callable
- the function to executedelay
- the time from now to delay executionunit
- the time unit of the delay parameterpublic ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
SwtExec
scheduleAtFixedRate
in interface ScheduledExecutorService
scheduleAtFixedRate
in class SwtExec
command
- the task to executeinitialDelay
- the time to delay first executionperiod
- the period between successive executionsunit
- the time unit of the initialDelay and period parameterspublic ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
SwtExec
scheduleWithFixedDelay
in interface ScheduledExecutorService
scheduleWithFixedDelay
in class SwtExec
command
- the task to executeinitialDelay
- the time to delay first executiondelay
- the delay between the termination of one
execution and the commencement of the nextunit
- the time unit of the initialDelay and delay parameters