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

Improve object destruction handling #59

Open
medikoo opened this issue Mar 14, 2016 · 0 comments
Open

Improve object destruction handling #59

medikoo opened this issue Mar 14, 2016 · 0 comments
Assignees

Comments

@medikoo
Copy link
Owner

medikoo commented Mar 14, 2016

Currently when object is destructed, all property values are deleted, it's prototype is changed to db.Base.prototype and emitters for all property changes emit with new values (undefined).

Cleaner probably would be to:

  • Detach observers from properties (so clean all listeners from property observers)
  • Downgrade object prototype (that should result with some events, e.g. object removed from instances set).

Above should also allow to produce configuration that's scalable in sense that some objects can be permanently cleared and even re-added. It can be agreed that once destroyed object is never resurrected with same object instance, but new one is created if such action is desired.

We should also be able to distinguish two actions:

  • Deletion of object, in such aside of object being destroyed, the records that remove all properties and object itself should also be propagated with (persistent db) events
  • Remove of object from memory. It should be pure removal from memory, no persistent db events, just memory events that concern object visibility should be propagated
@medikoo medikoo self-assigned this May 2, 2016
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

1 participant