CallbackWithTimeout

CallbackWithTimeout

This class makes sure the callback is called only once. If the timeout expired, the callback is called with a "Timeout Expired" error. Otherwise it is called with provided args.

Constructor

new CallbackWithTimeout()

Methods

invalidate()

After this method is called, the callback can no longer be invoked.

tryInvoke(…args)

If this object has not yet been invalidated, the callback is called.

Parameters:
Name Type Attributes Description
args <repeatable>