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 IDBCursor.close() #185

Open
inexorabletash opened this issue Mar 28, 2017 · 6 comments · May be fixed by #302
Open

Add IDBCursor.close() #185

inexorabletash opened this issue Mar 28, 2017 · 6 comments · May be fixed by #302

Comments

@inexorabletash
Copy link
Member

Cursors require maintaining a fair bit of state. Implementations may also do optimizations such as pre-fetching records. This state can only be completely released when either the cursor hits the end of its range or both the request and the cursor have been GC'd (since there's an implicit bidirectional dependency), or when the transaction ends.

It might be nice to expose a close() method on cursors to allow web apps to signal that a cursor can be tidied up prior transaction closing.

@inexorabletash
Copy link
Member Author

TPAC 2019 Web Apps Indexed DB triage notes:

We are in favor, especially as we're already tweaking the IDBCursor interface in V3.

@inexorabletash
Copy link
Member Author

This would be easiest to define and test if we allow calling close() at the same times that we allow calling continue(), namely when the owning transaction is active and the cursor's got value flag is true, and throw otherwise.

Otherwise, it's racy: there could be an outstanding continue() (or advance() etc) call running, with the associated request in a pending state.

@aliams @pwnall @asutherland - does that restriction sound acceptable?

@inexorabletash inexorabletash linked a pull request Sep 27, 2019 that will close this issue
5 tasks
@pwnall
Copy link

pwnall commented Sep 27, 2019

SGTM.

@aliams
Copy link

aliams commented Sep 28, 2019

SGTM!

@asutherland
Copy link
Collaborator

asutherland commented Sep 28, 2019

TMSG. (To me, sounds good!)

@SteveBeckerMSFT SteveBeckerMSFT added the TPAC2024 Topic for discussion at TPAC 2024 label Sep 9, 2024
@SteveBeckerMSFT
Copy link

SteveBeckerMSFT commented Oct 1, 2024

TPAC 2024: We revisited this topic, which still seems like a good addition. Additional data and use cases would help browsers prioritize an implementation.

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

Successfully merging a pull request may close this issue.

5 participants