Last active
August 29, 2017 07:01
-
-
Save bytekast/d5e2a60a54e365a2d10158f46c685836 to your computer and use it in GitHub Desktop.
Chaining Promises in Groovy GPars
This file contains 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
final successHandler = { controller.successEvent(context, transmissionUuid, parcel) } | |
final errorHandler = { Exception e -> controller.errorEvent(context, transmissionUuid, parcel, e) } | |
task { controller.download(sessionId, parcel) } | |
.then { download -> controller.save(download, transmissionUuid, parcel) } | |
.then { download -> controller.forward(download, transmissionUuid, parcel) } | |
.then { controller.delete(sessionId, parcel.id) } | |
.then(successHandler, errorHandler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment