Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IAsyncLoop2

interface IAsyncLoop2
Extends IAsyncLoop Extension of [IAsyncLoop] that supports delayed and scheduled task dispatch.

Methods

scheduleAfter()

IFuture* scheduleAfter(ICallable* callable, com.amazon.apmf.MonotonicDuration delay)
Runs the 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


scheduleDetachedAfter()

void scheduleDetachedAfter(ICallable* callable, com.amazon.apmf.MonotonicDuration delay)
Runs the 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


Last modified on October 29, 2026