class Counter extends AnyRef
An asynchronous counter that can be used to across the cluster to maintain a consistent count.
- Alphabetic
- By Inheritance
- Counter
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Counter(_asJava: AnyRef)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addAndGet(value: Long, resultHandler: Handler[AsyncResult[Long]]): Unit
Add the value to the counter atomically and return the new count * @param value the value to add
Add the value to the counter atomically and return the new count * @param value the value to add
- resultHandler
handler which will be passed the value
-
def
addAndGetFuture(value: Long): scala.concurrent.Future[Long]
Like addAndGet but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJava: AnyRef
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
compareAndSet(expected: Long, value: Long, resultHandler: Handler[AsyncResult[Boolean]]): Unit
Set the counter to the specified value only if the current value is the expectec value.
Set the counter to the specified value only if the current value is the expectec value. This happens atomically. * @param expected the expected value
- value
the new value
- resultHandler
the handler will be passed true on success
-
def
compareAndSetFuture(expected: Long, value: Long): scala.concurrent.Future[Boolean]
Like compareAndSet but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
decrementAndGet(resultHandler: Handler[AsyncResult[Long]]): Unit
Decrement the counter atomically and return the new count * @param resultHandler handler which will be passed the value
-
def
decrementAndGetFuture(): scala.concurrent.Future[Long]
Like decrementAndGet but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get(resultHandler: Handler[AsyncResult[Long]]): Unit
Get the current value of the counter * @param resultHandler handler which will be passed the value
-
def
getAndAdd(value: Long, resultHandler: Handler[AsyncResult[Long]]): Unit
Add the value to the counter atomically and return the value before the add * @param value the value to add
Add the value to the counter atomically and return the value before the add * @param value the value to add
- resultHandler
handler which will be passed the value
-
def
getAndAddFuture(value: Long): scala.concurrent.Future[Long]
Like getAndAdd but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
getAndIncrement(resultHandler: Handler[AsyncResult[Long]]): Unit
Increment the counter atomically and return the value before the increment.
Increment the counter atomically and return the value before the increment. * @param resultHandler handler which will be passed the value
-
def
getAndIncrementFuture(): scala.concurrent.Future[Long]
Like getAndIncrement but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getFuture(): scala.concurrent.Future[Long]
Like get but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
incrementAndGet(resultHandler: Handler[AsyncResult[Long]]): Unit
Increment the counter atomically and return the new count * @param resultHandler handler which will be passed the value
-
def
incrementAndGetFuture(): scala.concurrent.Future[Long]
Like incrementAndGet but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )