Interface IAsyncLoop2
interface IAsyncLoop2
Extends IAsyncLoop
Extension of [IAsyncLoop] that supports delayed and scheduled task dispatch.
Methods
scheduleAfter()
Runs theIFuture*scheduleAfter(ICallable*callable,com.amazon.apmf.MonotonicDurationdelay)
ICallable with a time delay. An ICallable submitted to multiple
IAsyncLoops will be run once by each.
Parameters
callable
ICallable* — Required
A pointer to the ICallable to run.
delay
com.amazon.apmf.MonotonicDuration — Required
The time delay before running the ICallable.
Returns
IFuture*
The IFuture corresponding to the ICallable
Throws
InvalidArgumentError— if callable is null.
scheduleDetachedAfter()
Runs thevoidscheduleDetachedAfter(ICallable*callable,com.amazon.apmf.MonotonicDurationdelay)
ICallable with a time delay without returning an IFuture.
The callable cannot be canceled once it is submitted.
Unhandled exceptions from the ICallable propagate to the
async loop thread.
Parameters
callable
ICallable* — Required
A pointer to the ICallable to run.
delay
com.amazon.apmf.MonotonicDuration — Required
The time delay before running the ICallable.
Throws
InvalidArgumentError— if callable is null.

