or create a client. MemcachedClient client=[...]; // Get a Transcoder. Transcoder tc = new LongTranscoder(); // Get a mutator instance that uses that client. CASMutator<Long> mutator=new CASMutator<Long>(client, tc); // Get a mutation that knows what to do when a value is found. CASMutation<Long> mutation=new CASMutation<Long>() { public Long getNewValue(Long current) { return current + 1; } }; // Do a mutation. long currentValue=mutator.cas(someKey, 0L, 0, mutation);
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.