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
Every object that Horizon stores in RethinkDB will have a $reql_version$ field (we've already reserved the $reql_*$ namespace for internal use) that is set to a UUID, and every write operation issued by Horizon will also update that version to a new UUID. This version will never be passed to the user of the Horizon client library, we'll strip it out before objects reach them.
atomicReplace will be implemented like so:
Fetch the document, record its version V.
Call the function passed to atomicReplace, get a new document D.
If we get the "retry" error, go back to step 1. Otherwise we're done.
The advantage of this interface is that it lets you issue a write that will never be clobbered by another concurrent write. So in the example above, if you issue 5 of those increment operations, you know that a will be larger by exactly 5 when they all complete.
Leaving this to @mlucy to fill out details.
The text was updated successfully, but these errors were encountered: