Closed ronag closed 1 year ago
Writes are not ordered (at least by design, and I doubt that napi_create_async_work
is ordered, seeing as its purpose is parallel work). For the majority of users that's perfectly fine. Introducing a work queue would be a major change, and quite complicated, so I want to see many upvotes before considering it. Until then it can be handled in userland, where you have a choice of doing things in parallel or sequentially.
I think we might need to add a clear warning for this in the docs. I for one assumed that they would be ordered.
That would be good. PR welcome.
Done as part of https://github.com/Level/abstract-level/pull/42.
I see that we are using
napi_create_async_work
. However, I can't read anywhere whether or not work items are guaranteed to be executed in order or not. If not then we might have a problem with write ordering, i.e. preceding writes overwriting following writes.Do we need to create our own per db ordered work queue?