Callback tryOnSuccess/tryOnFailure#971
Merged
Merged
Conversation
Avasil
reviewed
Aug 3, 2019
Avasil
approved these changes
Aug 3, 2019
Member
Author
|
This one is ready for merging. I added tests and changed the behavior of the |
Collaborator
|
Thanks @alexandru , we'll get it in for the release |
Collaborator
|
I'm merging it @oleg-py but if you have any objections/suggestions we can patch it in next PR |
mdedetrich
pushed a commit
to mdedetrich/monix
that referenced
this pull request
Mar 28, 2020
* Callback tryOnSuccess/tryOnFailure * Callback safety and tests * Hide protectedCallback * Fix doOnCancel * Fix callback in TaskCreate * Add test for popping the connection * Docs, tests * Docs * Cleanup * More try methods * More tests * More tests for Task.create * More fixes, more tests * Simplification * Formatting * Address review * Fix compilation for 2.11 * Nulify error * Refactoring
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a continuation of #917.
Thread-safe implementations of
Callback(that protect theCallback's contract) are supposed to throwCallbackCalledMultipleTimesExceptionin case the result was signaled more than once.The callbacks returned the
Callback.safe,Callback.trampolineandCallback.forkedwrappers are now all thread-safe. The callback injected inTask.create(and variants) is thread-safe as well.Also added 2 methods on
Callback:tryOnSuccessandtryOnFailure. These forward by default the call toonSuccessandonError. If these throw, then the exception gets caught in thetry*versions.