TKMPromiseSource

Instances of this class are used to create and complete TKMPromise<T> instances. Instances of this class are produced with a reference to an TKMAsyncScheduler, which is used to invoke continuations on the returned TKMPromise<T>. By default, the current scheduler is captured when calling the constructor.

  • Creates an instance based on the current schedule as returned by AsyncSchedulers#current().

  • Creates an instance based on the given scheduler.

  • Returns the TKMPromise<T> associated with this instance.

  • Returns whether this instance and the returned TKMPromise<T> are in completed state, regardless of whether completed successfully or exceptionally.

  • Completes the TKMPromise<T> associated with this instance with the given value. throws JavaLangIllegalStateException if already in completed state.

  • Tries to complete the TKMPromise<T> associated with this instance with the given value. Ignores the given value if already in completed state.

  • Exceptionally completes the TKMPromise<T> associated with this instance with the given Error. throws JavaLangIllegalStateException if already in completed state.

  • Tries to exceptionally complete the TKMPromise<T> associated with this instance with the given Error. Ignores the given value if already in completed state.