Skip to content

Instantly share code, notes, and snippets.

@abhi-bit
Created March 4, 2015 08:47
Show Gist options
  • Save abhi-bit/49769d7e15877c262ebf to your computer and use it in GitHub Desktop.
Save abhi-bit/49769d7e15877c262ebf to your computer and use it in GitHub Desktop.
Sync cas
// Set test key to cluster
client.set("test-key", "couchbase!").get();
// Grab cas value
CASValue<Object> lock = client.gets("test-key");
long cas_id = lock.getCas();
client.cas("test-key", cas_id, "test-value");
System.out.println((String) client.get("test-key"));
@ctauro
Copy link

ctauro commented Mar 4, 2015

woah! Thanks..:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment