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 #45

mkotsbak opened this issue Nov 15, 2015 · 1 comment


Copy link

commented Nov 15, 2015

(From widok/widok#29)

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 { _ =>

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.


This comment has been minimized.

Copy link

commented Jan 14, 2016

I think that manually resource management should be avoided, e.g. dispose method.

It's better to implement some kinds of reference counting algorithm like Binding.scala did.

@tindzk tindzk added this to the v0.1.6 milestone Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.