Giter Site home page Giter Site logo

Comments (3)

davissuber avatar davissuber commented on June 2, 2024 1

When using RIBs with simple-store - it's quite reasonable to use the lifecycle provided by RIBs to manage simple-store (or any other resource that can only be opened once and needs to be closed when done).

In the current ordering where the children outlives the parent RIB, if one opens the simple-store in the parent RIB with the intention that both the parent RIB itself and the child RIB will make use of the store - there's a small window where the parent RIB will be deactivated (and the store cleaned up) while there are still activities coming from the children that make use of the store.

We are seeing some sporadic "the store is already closed" errors that could be caused by the current parent-child-deactivation-ordering - but still collecting evidence of such claim / find other causes and want to do some tentative finger-pointing in the process.

from ribs.

psteiger avatar psteiger commented on June 2, 2024

Did you encounter a specific use case where you would rather have your suggested behavior instead of the current behavior?

With that asked, in principle I agree with you: children must have a lifecycle less than or equal to the parent, so it makes sense for them to be deactivated before the parent.

from ribs.

davissuber avatar davissuber commented on June 2, 2024

An update: we are able to repro the issue and it does seem that this ordering of children outliving the parent is creating problem for unsuspecting developers who binds an SimpleStore to the parent RIB's lifecycle, and use the store in the children lifecycle.

Perhaps the sharing of simple store across different scope provider per se is a bad way to use that library and one shouldn't make any strong assumption between parent and child scope deactivation order. 🤷

At any rate, given the potential impact of swapping the deactivation order at RIBs level - we are seeking alternative solutions to our problem at the moment, but it is our belief that the current behavior is creating some surprises in managing resources like simple store.

from ribs.

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.