compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (5)

View Page History
{code}

Because the code above written in synchronous fashion, it is ok to wait *before* method will return the value. But in asynchronous mode we can return immediately.
To minimize network IO, there is {{observe_and_wait}} operation which will block the execution until the condition for given key set will be satisfied or timeout occurred.

{code:none}
conn.run do |c|
c.set("foo", "bar", :observe => {:replicas => 1, :persisted => 2})
c.append("baz", "bar", :observe => {:persisted => 4})
c.observe_and_wait
end
conn.set("foo", "bar")
conn.append("baz", "bar")
conn.observe_and_wait("foo", "baz", :persisted => 2, :timeout => 5)
{code}

The same kind of API is valid for asynchronous mode too.

h2. C