Top Description Methods
stormpot

public Interface Completion

Known Direct Implementers
stormpot.LatchCompletion

A Completion represents some task that is going to be completed at some point in the future, or maybe already has completed. It is similar to Future but without any options for cancellation or returning a result. Indeed, you cannot even precisely tell if the task has already completed, but the await methods will return immediately if that is the case.
Author
Chris Vest
See Also
Pool#shutdown()

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

`true` if the task represented by this completion completed within the specified waiting time, or was already complete upon entry to this method; or `false` if the specified Timeout elapsed before the task could finished.
await
(Timeout
The timeout delimiting the maximum time to wait for the task to complete. Timeouts with zero or negative values will cause the method to return immediately.
timeout
)

Causes the current thread to wait until the completion is finished, or the thread is interrupted, or the specified waiting time elapses.

Method Detail

awaitback to summary
public boolean await(Timeout timeout) throws InterruptedException

Causes the current thread to wait until the completion is finished, or the thread is interrupted, or the specified waiting time elapses. If the task represented by this completion has already completed, the method immediately returns `true`. If the current thread already has its interrupted status set upon entry to this method, or the thread is interrupted while waiting, then an InterruptedException is thrown and the current threads interrupted status is cleared. If the specified waiting time elapses, then the method returns `false`.

Parameters
timeout:Timeout

The timeout delimiting the maximum time to wait for the task to complete. Timeouts with zero or negative values will cause the method to return immediately.

Returns:boolean

`true` if the task represented by this completion completed within the specified waiting time, or was already complete upon entry to this method; or `false` if the specified Timeout elapsed before the task could finished.

Exceptions
InterruptedException:
if the current thread is interrupted while waiting.
IllegalArgumentException:
if the provided `timeout` parameter is `null`.