Giter Site home page Giter Site logo

Comments (8)

ZacSweers avatar ZacSweers commented on April 28, 2024

Thank you so much David! I'll get on these today. Would you mind if I added you as a reviewer on the subsequent PR(s)?

from autodispose.

akarnokd avatar akarnokd commented on April 28, 2024

Sure.

from autodispose.

ZacSweers avatar ZacSweers commented on April 28, 2024

Working on a branch and had a few questions/comments.

The DisposableMaybeObserver could be created and setOnce'd before the call to lifecycle.subscribe()

Is this due to using subscribeWith()? If so, would the safer solution be to implement the full observer + disposable setting manually in onSubscribe()?

AutoDisposePlugins.java#L36: Such lockdown support may not be desirable on Android. The same feature was aimed at server/J2EE container use of RxJava.

True, but this was built to be a Java library first with android extensions :). Mostly added to keep the semantics familiar to RxJava.

dependencies.gradle#L65: Using a pretty old RxJava 2 version.

Good point. I tend to prefer making extension libraries depend on lower versions of libraries to avoid imposing burden on consumers that maybe haven't been able to update yet (we hit this often). I suppose it could also become a liability if new changes caused unknown behavior changes here. I'll think on this more.

AutoDisposingCompletableObserverImpl.java#L58: May not be a good idea to leave the delegate non-terminated in this case, if the lifecycle actually can get onComplete.

I should elaborate that comment in source a bit. The behavior is such that if the scope "completes", then the binding is considered "unbound" and free to execute to termination. The idea is that scopes might sometimes be required for an API, but consumers of that API may want to just indicate that they can be unbound. They may dynamically resolve to be unbound under certain conditions at runtime too, and I wanted to support making that explicit. Otherwise scopes could just be defined as Single. Does that get to what you were raising above? If so - what do you think of that approach?

from autodispose.

akarnokd avatar akarnokd commented on April 28, 2024

Is this due to using subscribeWith()? If so, would the safer solution be to implement the full observer + disposable setting manually in onSubscribe()?

The problem is that this subscription happens before the associates setOnce even runs, thus the once-ness is enforced a bit late. I'd create the lifecycle observer type first, call setOnce and then lifecycle.subscribe() after.

If so - what do you think of that approach?

Risky. It would leave the consumer that is interested in handling onComplete without events, which could leak resources. This was a problem in RxLifecycle if I remember correctly.

from autodispose.

ZacSweers avatar ZacSweers commented on April 28, 2024

Could you expand on this bit some? I'm not sure I follow

consumer that is interested in handling onComplete without events

Particularly, the terminal emissions of the scope emissions are not visible outside of the autodisposing observer implementations, so I'm not sure which consumer would be interested in handling it. If the lifecycle onCompletes, the delegate is basically free to execute unbounded, and will never be manually disposed by AutoDispose.

from autodispose.

akarnokd avatar akarnokd commented on April 28, 2024

I'm sorry I have to postpone further explanations till next week as I have an important submission deadline coming up.

from autodispose.

ZacSweers avatar ZacSweers commented on April 28, 2024

No problem at all!

from autodispose.

ZacSweers avatar ZacSweers commented on April 28, 2024

Done in #138

from autodispose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.