Represents the result of an action that may, or may not, have occurred yet.

  • Future
    • Basic
      • Identifiable
      • Object
        • Anything

no subtypes hierarchy

Initializer
Future(Future<out Object> unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
completeshared default void complete()

Set a null result. Any handler will be called, if there is one, and the future will be marked as completed.

completeshared default void complete(T? result)

Set the result. Any handler will be called, if there is one, and the future will be marked as completed.

Parameters:
  • result

    the result

failshared default void fail(String failureMessage)

Set the failure. Any handler will be called, if there is one, and the future will be marked as completed.

Parameters:
  • failureMessage

    the failure message

isCompleteshared default Boolean isComplete()

Has the future completed?

It's completed if it's either succeeded or failed.

setHandlershared default void setHandler(Anything(Throwable|T?) handler)

Set a handler for the result.

If the future has already been completed it will be called immediately. Otherwise it will be called when the future is completed.

Parameters:
  • handler

    the Handler that will be called with the result

Inherited Methods
Methods inherited from: Object
equals