-
Notifications
You must be signed in to change notification settings - Fork 1.9k
SharedFlow didn't cancel or throw exception with callbackFlow #2368
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
Comments
Sorry, but I cannot figure out what you are trying to achieve. Do you run into the problem with |
@elizarov I added more details could you please check it now? |
To achive what you need you can do something like this:
Because you use Does it help? P.S. In the future we plan to provide some ready-to-use operators for that. See #2092 |
Yes this is a nice trick but I wonder why
catch after shareIn didn't catch anything and app crashes.
Didn't work. |
|
The exception didn't throw to parent scope or cancel itself while using SharedFlow with callbackFlow. I tried to cancel sharedflow in case of failure. Here is my code snippet
I used it
Here is another way tried to accomplish the same thing
I used this as previous but this time
sharedflow.collect|first()|take(1){} stays always in resume state I want to cancel it in case of failure.
The text was updated successfully, but these errors were encountered: