SinkLike
Provides all of the operations of a Sink[A]
, without the ability to get
a Sink.View
.
Provides all of the operations of a Sink[A]
, without the ability to get
a Sink.View
.
- Authors
Nathan Bronson
Value members
Abstract methods
Performs a transactional write. The new value will not be visible by
any other threads until (and unless) txn
successfully commits.
Equivalent to update(v)
.
Performs a transactional write. The new value will not be visible by
any other threads until (and unless) txn
successfully commits.
Equivalent to update(v)
.
- Value Params
- v
a value to store in the
Ref
.
- Throws
- IllegalStateException
if
txn
is not active.
Performs a transactional write and returns true, or returns false. The STM implementation may choose to return false to reduce (not necessarily avoid) blocking. If no other threads are performing any transactional or atomic accesses then this method will succeed.
Performs a transactional write and returns true, or returns false. The STM implementation may choose to return false to reduce (not necessarily avoid) blocking. If no other threads are performing any transactional or atomic accesses then this method will succeed.
Concrete methods
Performs a transactional write. The new value will not be visible by
any other threads until (and unless) txn
successfully commits.
Equivalent to set(v)
.
Performs a transactional write. The new value will not be visible by
any other threads until (and unless) txn
successfully commits.
Equivalent to set(v)
.
Example:
val x = Ref(0)
atomic { implicit t =>
...
x() = 10 // perform a write inside a transaction
...
}
- Value Params
- v
a value to store in the
Ref
.
- Throws
- IllegalStateException
if
txn
is not active.