6.6. 原子双精度浮点(AtomicDouble)

Redisson还提供了分布式原子双精度浮点RAtomicDouble,弥补了Java自身的不足。除了同步接口外,还提供了异步(Async)、反射式(Reactive)和RxJava2标准的接口。

  1. RAtomicDouble atomicDouble = redisson.getAtomicDouble("myAtomicDouble");
  2. atomicDouble.set(2.81);
  3. atomicDouble.addAndGet(4.11);
  4. atomicDouble.get();