org.apache.ignite.ml.environment.parallelism

## Interface Promise<T>

- Type Parameters:
    `T` - Type of result.
  All Superinterfaces:
    Future<T>
  All Known Implementing Classes:
    DefaultParallelismStrategy.FutureWrapper, NoParallelismStrategy.Stub

      public interface Promise<T>
      extends Future<T>

  Future interface extension for lambda-friendly interface.

- - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default Optional<T>` | `getOpt()` Wrap result of Future to Optional-object.
    `default T` | `unsafeGet()` Await result of Future and return it.

    - ### Methods inherited from interface java.util.concurrent.Future

      `cancel, get, get, isCancelled, isDone`

- - ### Method Detail

    - #### unsafeGet

          default T unsafeGet()

      Await result of Future and return it. Wrap exceptions from Future to RuntimeException.

    - #### getOpt

          default Optional<T> getOpt()

      Wrap result of Future to Optional-object. If Future throws an exception then it returns Optional.empty.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020