ExecutionState

An union defining the possible states of a Future.

This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Documentation

An union defining the possible states of a Future.

Properties

Debugging

inspect: toString()

A textual representation of the state.

Experimental
toString()

A textual representation of the state.

Experimental

Meta-programming

derive(...derivations)

Allows a function to provide functionality to variants in an union.

ExperimentalInherited

Special Values

variants

The variants in the ExecutionState

Experimental

Testing and Comparing

hasInstance(value)

True if the value is any execution state instance.

Experimental

Variant

Cancelled()

The state of a future that has been cancelled.

Experimental
Pending()

The state of a future that's still not resolved.

Experimental
Rejected(reason)

The state of a future that has been resolved with a failure.

Experimental
Resolved(value)

The state of a future that has been successfully resolved with a value.

Experimental

Source Code

Defined in source/concurrency/future/_execution-state.js at line 19, column 0
union('folktale:ExecutionState', {
  /*~
   */
  Pending() {
    return {};
  },

  /*~
   */
  Cancelled() {
    return {};
  },

  /*~
   */
  Resolved(value) {
    return { value };
  },

  /*~
   */
  Rejected(reason) {
    return { reason };
  }
}).derive(equality, debugRepresentation)
Stability
experimental
Licence
MIT
Module
folktale/concurrency/future/_execution-state
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)