Skip to content
This repository has been archived by the owner on Dec 6, 2018. It is now read-only.

isOpen #48

Open
dominictarr opened this issue Jan 4, 2014 · 5 comments
Open

isOpen #48

dominictarr opened this issue Jan 4, 2014 · 5 comments

Comments

@dominictarr
Copy link
Owner

mentioned here:

levelgraph/levelgraph#53

it should just return whatever the root level returns for isOpen

@mcollina
Copy link

mcollina commented Jan 4, 2014

Thanks for opening this in here! I have been lazy with that and went for the short term fix, given that a rewrite of sublevel might happen #46 and the whole writestream removal business Level/levelup#207 is going to change everything anyway.

@dominictarr
Copy link
Owner Author

this would be a very easy change, and if levelup has it, sublevel should, just put it here to remind myself!

@elf-pavlik
Copy link

if levelup has it, sublevel should

how would you go about close()? @mcollina needed to wrap it while adding support for levelgraph on sublevel:
https://github.com/mcollina/levelgraph/blob/b133a18fc7ae8d660ab90b3bf41e301e682af8c8/lib/levelgraph.js#L77-L83

@dominictarr
Copy link
Owner Author

close should just deregister all event hooks, and take detach the sublevel object so that it can be GCd.

see discussion in this issue: #38

@TehShrike
Copy link
Contributor

This came up in level-ttl a few months back. I think a good convention for levelup implementers would be to have a stop() function that removes all event hooks, with close() calling stop and also closing the underlying store.

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

No branches or pull requests

4 participants