An asynchronous operation is one that might be completed outside a given Actor of execution. The operation can either be performing computation, or I/O, or both.
All I/O operations in Otavia are asynchronous. It means any I/O calls will return immediately with no guarantee that the requested I/O operation has been completed at the end of the call. Instead, you will be returned with a Future instance which gives you the information about the result or status of the I/O operation.
A Future is either uncompleted or completed. When an I/O operation begins, a new future object is created. The new future is uncompleted initially - it is neither succeeded, failed, nor cancelled because the I/O operation is not finished yet. If the I/O operation is finished either successfully, with failure, or by cancellation, the future is marked as completed with more specific information, such as the cause of the failure. Please note that even failure and cancellation belong to the completed state.
Return the successful result of this asynchronous operation, if any. If the operation has not yet been completed, then this will throw IllegalStateException . If the operation has been failed with an exception, then this throw cause .
Return the successful result of this asynchronous operation, if any. If the operation has not yet been completed, then this will throw IllegalStateException . If the operation has been failed with an exception, then this throw cause .
Attributes
Returns
the result of this operation, if completed successfully.