Created
October 2, 2013 14:19
-
-
Save carchrae/6794509 to your computer and use it in GitHub Desktop.
My take on a java promise interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface Promise<T> { | |
| Promise<T> resolve(T value); | |
| Promise<T> resolve(Promise<T> promise); | |
| Promise<Throwable> reject(Throwable e); | |
| Promise<T> then(CallbackFunction onResolved); | |
| Promise<T> then(CallbackFunction onResolved, CallbackFunction onError); | |
| Promise<T> then(CallbackFunction onResolved, CallbackFunction onError, | |
| CallbackFunction onNotify); | |
| Promise<T> ensure(CallbackFunction handler); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment