Trait

scala.concurrent.stm.CommitBarrier

Member

Related Doc: package CommitBarrier

Permalink

trait Member extends AnyRef

A participant in a synchronized group commit. Each member of a commit barrier must arrange for either atomic or cancel to be called, otherwise the other members won't be able to commit.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Member
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def atomic[Z](body: (InTxn) ⇒ Z): Either[CancelCause, Z]

    Permalink

    Atomically executes body as part of a commit barrier, ensuring that if the transaction commits, all actions performed by all members of the commit barrier appear to occur simultaneously.

    Atomically executes body as part of a commit barrier, ensuring that if the transaction commits, all actions performed by all members of the commit barrier appear to occur simultaneously. If the transaction commits then the value v returned by body is returned as Right(v). If this member is cancelled then this method returns Left(c), where c describes the first cause passed to the cancel method. If this member is not cancelled but the transaction is rolled back without the possibility of retry, then this method throws an exception the same as any other atomic block (see TxnExecutor.apply).

    It is not allowed to chain orAtomic onto this form of atomic, but you can accomplish the same effect with a nested atomic block:

    member.atomic { implicit txn =>
      atomic { implicit txn =>
        ... first alternative
      } orAtomic { implicit txn =>
        ... second alternative
      }
    }

    In the current version of ScalaSTM this method may only be used if there is no enclosing transaction; an STM implementation may throw IllegalStateException if there is already an active transaction on this thread. This restriction might be relaxed in the future if there is a use case for it (and a semantics for how it should work).

    body

    the code to run atomically

    returns

    Right(v) where v is the result of successfully running body in an atomic block, or Left(c) where c is the reason for this member's cancellation

    Exceptions thrown

    IllegalStateException if called from inside the dynamic scope of an existing transaction and that is not supported by the chosen STM implementation

  2. abstract def cancel(cause: UserCancel): Unit

    Permalink

    Removes this member from the commit barrier, and causes any pending or future calls to this.atomic to return a Left.

    Removes this member from the commit barrier, and causes any pending or future calls to this.atomic to return a Left. If the commit barrier has already committed successfully this method throws IllegalStateException. It is safe to call this method multiple times.

    cause

    the cancel cause to return from atomic

    Exceptions thrown

    IllegalStateException if the commit barrier has already decided to commit

  3. abstract def commitBarrier: CommitBarrier

    Permalink

    Returns the commit barrier of which this instance is a member.

  4. abstract def executor: TxnExecutor

    Permalink

    Returns the TxnExecutor that will be used by atomic.

    Returns the TxnExecutor that will be used by atomic. This is initialized during construction to the default TxnExecutor (returned by scala.concurrent.stm.atomic).

  5. abstract def executor_=(v: TxnExecutor): Unit

    Permalink

    Changes the TxnExecutor that will be used by atomic.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  15. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped