Created
November 30, 2015 11:59
-
-
Save albertodebortoli/dc37a9716efc83e8644e to your computer and use it in GitHub Desktop.
Futures & Promises brainstorming
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
[self job1].continueWith(^{ | |
return [self job2]; | |
}).continueWith(^{ | |
return [self job3]; | |
}) | |
[JEPromise executeWaterfall(^{ | |
return [self job1].[self job2].[self job3]; | |
}).finally(^(JEFuture *fut){ | |
switch (fut.progress) { | |
case job1: { | |
break; | |
} | |
case job3: { | |
break; | |
} | |
default: break; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment