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

Feature: relays .asInfallible() #2429

Closed
mashe opened this issue Jun 18, 2022 · 3 comments
Closed

Feature: relays .asInfallible() #2429

mashe opened this issue Jun 18, 2022 · 3 comments

Comments

@mashe
Copy link

mashe commented Jun 18, 2022

Hello,

I have played around with Infallible and noticed that neither of Relays (PublishRelay, BehaviorRelay nor ReplayRelay) could not be converted into a Infallible without providing a fallback. Relays never end or emit error so I guess it is fine to be converted into Infallible with asInfallible().

What do you think? Am I missing something?

@freak4pc
Copy link
Member

I think this is an interesting idea but I'll need some more time to think about it to make sure there aren't any obvious issues around this that I'm missing. Thanks for the idea and PR!

@rtharston
Copy link

I second this! I am currently converting Observable objects to Infallible in our application, but in some instances I can't easily because Relays don't convert to Infallible.
In some cases I've used asInfallible(onErrorRecover:) to log the impossible error and then return Infallible.empty() to continue.

@freak4pc
Copy link
Member

freak4pc commented Aug 6, 2022

I'm closing this, we can keep discussing in #2430. Thanks!

@freak4pc freak4pc closed this as completed Aug 6, 2022
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

No branches or pull requests

3 participants