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

Add close() to Storage #38

Closed
cinnamon-bun opened this issue Aug 4, 2020 · 1 comment
Closed

Add close() to Storage #38

cinnamon-bun opened this issue Aug 4, 2020 · 1 comment

Comments

@cinnamon-bun
Copy link
Member

What's the problem you want solved?

Some Storage implementations might need to do clean-up operations when closing.

Is there a solution you'd like to recommend?

Add a close() method to the IStorage interface.

@cinnamon-bun cinnamon-bun added this to the v1 milestone Aug 4, 2020
@cinnamon-bun
Copy link
Member Author

Done in 6b564a2

    // Close this storage.
    // All functions called after this will throw a StorageIsClosedError,
    // except you can call close() as many times as you want.
    // Once closed, a Storage instance cannot be opened again.
    // TODO: what happens when a long-running process like a sync is happening, and the Storage is closed?
    close() : void;
    // Find out if the storage is closed.
    isClosed() : boolean;

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

1 participant