fdb-record-layer icon indicating copy to clipboard operation
fdb-record-layer copied to clipboard

Rename methods that change an index's state to indicate they are async

Open alecgrieser opened this issue 5 years ago • 1 comments

There a few methods that manipulate an index's state, and those are currently asynchronous as they can perform database reads (though, arguably, they should read those from memory and just error if the store state hasn't been loaded yet). However, as the method names do not end in Async, they can cause problems as it is easy to forget to wait on the result (as one often does not care about the actual result value). Additionally, it is probable that if there were a blocking call within the method, then the BlockingInAsync detector might not know to throw an error.

We should rename the methods so that they indicate that they are asynchronous. (In practice, this probably means deprecating the old names to avoid breaking our API.) Ideally...we would also create synchronous versions (or consider making them only synchronous), though doing that in a way that doesn't break the API might be difficult.

alecgrieser avatar Nov 14 '19 03:11 alecgrieser

One thing to note: doing this right now will cause merge skew with #774, so this should only be done after #774 is in (or the PR to create it should be ready to rebase).

alecgrieser avatar Nov 21 '19 18:11 alecgrieser