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

Resource management #29

Open
tindzk opened this issue Feb 11, 2015 · 1 comment
Open

Resource management #29

tindzk opened this issue Feb 11, 2015 · 1 comment
Milestone

Comments

@tindzk
Copy link
Contributor

tindzk commented Feb 11, 2015

Channels created within the scope of a page may never get disposed. Upon route change, all channels associated to the widgets are just not used anymore. Even if the JavaScript engine may free the memory in this situation, a better resource management mechanism is needed.

Most reactive combinators attach an anonymous function to the changes stream of their data structure. For example:

def take(count: Int): ReadBuffer[T] = {
  val res = Buffer[T]()
  val subscription = changes.attach { _ =>
    ...
  }
  res
}

Here, res should not be independent from subscription. Furthermore, the following dispose() relations should hold:

  • changes.dispose() calls subscription.dispose()
  • subscription.dispose() calls res.dispose()
  • res.dispose() calls subscription.dispose()

Resource management with regards to chained combinators is worth investigating as well.

Presently, some functions return delta streams which cannot provide a dispose() function. This may lead to resource leaks.

@mkotsbak
Copy link
Contributor

I assume most of this should be solved in MetaRx now: tindzk/MetaRx#45

Maybe there is something that should be done related to GUI widgets too, or is all covered by #101?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants