Top Description Fields Methods
com.oracle.bmc.waiter

public Interface WaiterScheduler

Imports
java.util.concurrent.CompletableFuture, .Future, .ScheduledExecutorService, .TimeUnit

Abstraction for GenericWaiter to implement the "schedule" functionality to implement asynchronous waiting. Basically a cut down version of ScheduledExecutorService, with only the ScheduledExecutorService#schedule(Runnable, long, TimeUnit) method.

Field Summary

Modifier and TypeField and Description
public static final WaiterScheduler
SYNC

Scheduler implementation that blocks in the schedule method for the given time to pass.

public static final WaiterScheduler
UNSUPPORTED

A WaiterScheduler where waiting is not supported.

Method Summary

Modifier and TypeMethod and Description
public static WaiterScheduler
fromService(ScheduledExecutorService service)

Create a new instance from the given ScheduledExecutorService.

public Future<?>
schedule(Runnable command, long time, TimeUnit unit)

Field Detail

SYNCback to summary
public static final WaiterScheduler SYNC

Scheduler implementation that blocks in the schedule method for the given time to pass. This removes the need for a separate threaded scheduler. GenericWaiter can handle the case where schedule blocks, so this will not deadlock or anything.

UNSUPPORTEDback to summary
public static final WaiterScheduler UNSUPPORTED

A WaiterScheduler where waiting is not supported. Always throws an exception. GenericWaiter will still succeed if the wait delay is configured as 0, but not if it's positive.

Method Detail

fromServiceback to summary
public static WaiterScheduler fromService(ScheduledExecutorService service)

Create a new instance from the given ScheduledExecutorService. Tasks will be run on that executor.

scheduleback to summary
public Future<?> schedule(Runnable command, long time, TimeUnit unit)