# Package com.codename1.util.promise

package com.codename1.util.promise

JavaScript-style `Promise` for asynchronous Codename One code.

`Promise` mirrors the ECMAScript Promise contract (`then`, `catch`, `finally`, `all`, `race`, `resolve`, `reject`) on top of Codename One's EDT and `invokeAndBlock` model. `Functor` and `ExecutorFunction` are the small functional interfaces the API hands callbacks to so it can remain Java 5 source-compatible.

- Related Packages
  Package
  Description
  com.codename1.util
  General utilities classes
  com.codename1.util.regex
  A simple regular expression API that is portable across all platforms
- Class
  Description
  ExecutorFunction
  Promise API function `com.codename1.util.promise.Promise`
  Functor<T,V>
  Promise API functor `com.codename1.util.promise.Promise`
  Promise<T>
  An implementation of Promise for use with Codename One applications.
  Promise.State
  Encapsulates the state of a Promise.