public interface IAsyncHandlerProvider
IAsyncHandler
for repetitive execution of runnablesModifier and Type | Interface and Description |
---|---|
static class |
IAsyncHandlerProvider.CycleResult |
Modifier and Type | Method and Description |
---|---|
boolean |
addStateListener(IAsyncHandlerProviderStateListener listener)
Adds a state listener to be notified on this provider state changes events
|
void |
close()
Close the async handler provider
|
boolean |
isClosed()
Specifies is this async handler provider is already closed
|
void |
removeStateListener(IAsyncHandlerProviderStateListener listener)
Removes the specified state listener
|
IAsyncHandler |
start(AsyncCallable callable,
long idleDelayMilis,
String name,
boolean waitIdleDelayBeforeStart)
Start executing a runnable in a repetitive manner.
|
IAsyncHandler |
startMayBlock(AsyncCallable callable,
long idleDelayMilis,
String name,
boolean waitIdleDelayBeforeStart)
Start executing a runnable in a repetitive manner, the task may block during its process so
the provider must be able to support this.
|
IAsyncHandler start(AsyncCallable callable, long idleDelayMilis, String name, boolean waitIdleDelayBeforeStart)
callable
- the runnable to execute at each iterationidleDelayMilis
- the delay between each iteration when the runnable returned a
IAsyncHandlerProvider.CycleResult.IDLE_CONTINUE
name
- hint name for the async handler if supportedwaitIdleDelayBeforeStart
- should the task run for the first time only after
idleDelayMillisIAsyncHandler.isTerminated()
.IAsyncHandler startMayBlock(AsyncCallable callable, long idleDelayMilis, String name, boolean waitIdleDelayBeforeStart)
callable
- the runnable to execute at each iterationidleDelayMilis
- the delay between each iteration when the runnable returned a
IAsyncHandlerProvider.CycleResult.IDLE_CONTINUE
name
- hint name for the async handler if supportedwaitIdleDelayBeforeStart
- should the task run for the first time only after
idleDelayMillisIAsyncHandler.isTerminated()
.void close()
boolean isClosed()
boolean addStateListener(IAsyncHandlerProviderStateListener listener)
void removeStateListener(IAsyncHandlerProviderStateListener listener)
Copyright © GigaSpaces.