Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a side effecting function called only on success. #61

Closed
wants to merge 1 commit into from

Conversation

ahadadi
Copy link
Collaborator

@ahadadi ahadadi commented Jan 16, 2017

No description provided.

* @param consumer the result consumer for the current future result
* @return a future with same value
*/
ComposableFuture<T> peek(Consumer<? super T> consumer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason I haven't added such method, is becase #andThen method provides Try object - on which on top you can perform same transformation functions (map, recover, etc).
I don't think there's a meaning in such method, and if so, should be j.u.f.Consumer of T and not Try :)

@@ -55,7 +55,7 @@
* Continues a future with a handler that will be called only if the original future resulted with success
* in case of an error the error is continued forward.
*
* @param mapper the continuation handler that returns a future
* @param mapper the continuation handler that returns a value or throws an exception.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@marenzo marenzo closed this Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants