Created
August 24, 2017 16:32
-
-
Save jonbodner/1fcbe7c54724f116d8a00a0fde7751bc to your computer and use it in GitHub Desktop.
future-blog-post-11
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
func (f *futureImpl) Then(next Step) Interface { | |
nextFuture := New(func() (interface{}, error) { | |
result, err := f.Get() | |
if err != nil { | |
return result, err | |
} | |
return next(result) | |
}) | |
return nextFuture | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment