Version 39 by avsej
on Jul 19, 2012 10:39.

compared with
Version 40 by avsej
on Jul 19, 2012 14:21.

This line was removed.
This word was removed. This word was added.
This line was added.

Changes (5)

View Page History

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.

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

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

h2. C