scala.concurrent.stm.CommitBarrier

Member

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
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

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

    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

    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

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

  4. abstract def executor: TxnExecutor

    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

    Changes the TxnExecutor that will be used by atomic.

Concrete Value Members

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

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

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

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

    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

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

    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  16. def toString(): String

    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped