final class AtomicDouble extends AtomicNumber[Double]
Atomic references wrapping Double
values.
Note that the equality test in compareAndSet
is value based,
since Double
is a primitive.
- Source
- AtomicDouble.scala
- Alphabetic
- By Inheritance
- AtomicDouble
- AtomicNumber
- Atomic
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final macro def +=(value: Double): Unit
Subtracts from the atomic number the given value.
Subtracts from the atomic number the given value. Alias for
subtract
.- Definition Classes
- AtomicNumber
- final macro def -=(value: Double): Unit
Adds to the atomic number the given value.
Adds to the atomic number the given value. Alias for
add
.- Definition Classes
- AtomicNumber
- final macro def :=(value: Double): Unit
Alias for set.
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def add(v: Double): Unit
Adds to the atomic number the given value.
Adds to the atomic number the given value.
- Definition Classes
- AtomicDouble → AtomicNumber
- Annotations
- @tailrec()
- def addAndGet(v: Double): Double
Adds to the atomic number and returns the result.
Adds to the atomic number and returns the result.
- Definition Classes
- AtomicDouble → AtomicNumber
- Annotations
- @tailrec()
- final macro def apply(): Double
Get the current value persisted by this Atomic, an alias for
get()
.Get the current value persisted by this Atomic, an alias for
get()
.- Definition Classes
- Atomic
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def compareAndSet(expect: Double, update: Double): Boolean
Does a compare-and-set operation on the current value.
Does a compare-and-set operation on the current value. For more info, checkout the related Compare-and-swap Wikipedia page.
It's an atomic, worry free operation.
- expect
is the value you expect to be persisted when the operation happens
- update
will be the new value, should the check for
expect
succeeds- returns
either true in case the operation succeeded or false otherwise
- Definition Classes
- AtomicDouble → Atomic
- def decrement(v: Int = 1): Unit
Decrements the atomic number with the given integer.
Decrements the atomic number with the given integer.
- Definition Classes
- AtomicDouble → AtomicNumber
- def decrementAndGet(v: Int = 1): Double
Decrements the atomic number and returns the result.
Decrements the atomic number and returns the result.
- Definition Classes
- AtomicDouble → AtomicNumber
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def get(): Double
Get the current value persisted by this Atomic.
Get the current value persisted by this Atomic.
- Definition Classes
- AtomicDouble → Atomic
- def getAndAdd(v: Double): Double
Adds to the the atomic number and returns the value before the update.
Adds to the the atomic number and returns the value before the update.
- Definition Classes
- AtomicDouble → AtomicNumber
- Annotations
- @tailrec()
- def getAndDecrement(v: Int = 1): Double
Decrements the atomic number and returns the value before the update.
Decrements the atomic number and returns the value before the update.
- Definition Classes
- AtomicDouble → AtomicNumber
- def getAndIncrement(v: Int = 1): Double
Increments the atomic number and returns the value before the update.
Increments the atomic number and returns the value before the update.
- Definition Classes
- AtomicDouble → AtomicNumber
- Annotations
- @tailrec()
- def getAndSet(update: Double): Double
Sets the persisted value to
update
and returns the old value that was in place.Sets the persisted value to
update
and returns the old value that was in place. It's an atomic, worry free operation.- Definition Classes
- AtomicDouble → Atomic
- def getAndSubtract(v: Double): Double
Subtracts from the atomic number and returns the value before the update.
Subtracts from the atomic number and returns the value before the update.
- Definition Classes
- AtomicDouble → AtomicNumber
- Annotations
- @tailrec()
- final macro def getAndTransform(cb: (Double) => Double): Double
Abstracts over
compareAndSet
.Abstracts over
compareAndSet
. You specify a transformation by specifying a callback to be executed, a callback that transforms the current value. This method will loop until it will succeed in replacing the current value with the one produced by the given callback.Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.
- cb
is a callback that receives the current value as input and returns the
update
which is the new value that should be persisted- returns
the old value, just prior to when the successful update happened
- Definition Classes
- Atomic
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def increment(v: Int = 1): Unit
Increment with the given integer
Increment with the given integer
- Definition Classes
- AtomicDouble → AtomicNumber
- Annotations
- @tailrec()
- def incrementAndGet(v: Int = 1): Double
Increments the atomic number and returns the result.
Increments the atomic number and returns the result.
- Definition Classes
- AtomicDouble → AtomicNumber
- Annotations
- @tailrec()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lazySet(update: Double): Unit
Eventually sets to the given value.
Eventually sets to the given value. Has weaker visibility guarantees than the normal
set()
.- Definition Classes
- AtomicDouble → Atomic
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val ref: BoxedLong
- def set(update: Double): Unit
Updates the current value.
Updates the current value.
- update
will be the new value returned by
get()
- Definition Classes
- AtomicDouble → Atomic
- def subtract(v: Double): Unit
Subtracts from the atomic number the given value.
Subtracts from the atomic number the given value.
- Definition Classes
- AtomicDouble → AtomicNumber
- Annotations
- @tailrec()
- def subtractAndGet(v: Double): Double
Subtracts from the atomic number and returns the result.
Subtracts from the atomic number and returns the result.
- Definition Classes
- AtomicDouble → AtomicNumber
- Annotations
- @tailrec()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final macro def transform(cb: (Double) => Double): Unit
Abstracts over
compareAndSet
.Abstracts over
compareAndSet
. You specify a transformation by specifying a callback to be executed, a callback that transforms the current value. This method will loop until it will succeed in replacing the current value with the one produced by the given callback.Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.
- cb
is a callback that receives the current value as input and returns the
update
which is the new value that should be persisted
- Definition Classes
- Atomic
- final macro def transformAndExtract[U](cb: (Double) => (U, Double)): U
Abstracts over
compareAndSet
.Abstracts over
compareAndSet
. You specify a transformation by specifying a callback to be executed, a callback that transforms the current value. This method will loop until it will succeed in replacing the current value with the one produced by your callback.Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.
- cb
is a callback that receives the current value as input and returns a tuple that specifies the update + what should this method return when the operation succeeds.
- returns
whatever was specified by your callback, once the operation succeeds
- Definition Classes
- Atomic
- final macro def transformAndGet(cb: (Double) => Double): Double
Abstracts over
compareAndSet
.Abstracts over
compareAndSet
. You specify a transformation by specifying a callback to be executed, a callback that transforms the current value. This method will loop until it will succeed in replacing the current value with the one produced by the given callback.Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.
- cb
is a callback that receives the current value as input and returns the
update
which is the new value that should be persisted- returns
whatever the update is, after the operation succeeds
- Definition Classes
- Atomic
- final macro def update(value: Double): Unit
Alias for set.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
This is the API documentation for the Monix library.
Package Overview
monix.execution exposes lower level primitives for dealing with asynchronous execution:
Atomic
types, as alternative tojava.util.concurrent.atomic
monix.catnap exposes pure abstractions built on top of the Cats-Effect type classes:
monix.eval is for dealing with evaluation of results, thus exposing Task and Coeval.
monix.reactive exposes the
Observable
pattern:Observable
implementationsmonix.tail exposes Iterant for purely functional pull based streaming:
Batch
andBatchCursor
, the alternatives to Scala'sIterable
andIterator
respectively that we are using within Iterant's encodingYou can control evaluation with type you choose - be it Task, Coeval, cats.effect.IO or your own as long as you provide correct cats-effect or cats typeclass instance.