You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Haven't been able to find a definitive answer on this. Does level down guarantee that writes are always visible for reads, in order.
e.g. is the following code guaranteed to always work?
db.put(key,val,(err)=>{/* assume no err */})db.get(key,(err,val2)=>{/* assume no err */assert.strictEqual(val,val2)})
Or do I need to do something like:
constpending=newMap()pending.set(key,val)db.put(key,val,(err)=>{/* assume no err */pending.delete(key)})db.get(key,(err,val2)=>{/* assume no err */val2=pending.get(key)??val2assert.strictEqual(val,val2)})
The text was updated successfully, but these errors were encountered:
e.g. is the following code guaranteed to always work?
No, because each operation (put, get, del, etc) starts an async worker that is independent of the others. We make no guarantee about the order of these.
Node.js might but if it does that should be considered a side-effect rather than by design.
Haven't been able to find a definitive answer on this. Does level down guarantee that writes are always visible for reads, in order.
e.g. is the following code guaranteed to always work?
Or do I need to do something like:
The text was updated successfully, but these errors were encountered: