io.soyl.elect

SingletonContext

Related Docs: object SingletonContext | package elect

class SingletonContext extends AnyRef

Handle class to provide context used by all singletons (mostly the Cassandra database connection for now)

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SingletonContext
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SingletonContext(session: ⇒ Session)

    session

    The Session to use for statement preparing and execution

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. def commitState(state: String, name: String)(implicit ec: ExecutionContext): Future[Unit]

    Commit a new state to be associated with the lock - workers use this state information to coordinate the work progress across invokations.

    Commit a new state to be associated with the lock - workers use this state information to coordinate the work progress across invokations.

    The date of the last run is not updated by this call because a commit is just intended to reduce re-processing in case of failure.

    state
    name
    ec
    returns

  7. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  11. def getLockInfo(name: String)(implicit ec: ExecutionContext): Future[Option[LockInfo]]

    Obtain the meta data of a given lock.

    Obtain the meta data of a given lock.

    name
    ec
    returns

    None if the lock is not yet present with meta data, Some(lockInfo) otherwise.

  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. def initLock(name: String, checkInterval: FiniteDuration = 20.seconds, ttl: FiniteDuration = 240.seconds, enabled: Boolean = false)(implicit ec: ExecutionContext): Future[Boolean]

    Initialize a lock entry with default / provided lock meta data.

    Initialize a lock entry with default / provided lock meta data. This is used by the first singleton manager that discovers that a given lock is not yet present.

    Uses Cassandra CAS functionality to ensure only one manager is initializing the lock.

    name
    checkInterval
    ttl
    enabled
    ec
    returns

  14. final def isInstanceOf[T0]: Boolean

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

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

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

    Definition Classes
    AnyRef
  18. def storeState(state: String, name: String)(implicit ec: ExecutionContext): Future[Unit]

    Store a new state to be associated with the lock - workers use this state information to coordinate the work progress across invokations.

    Store a new state to be associated with the lock - workers use this state information to coordinate the work progress across invokations.

    state
    name
    ec
    returns

  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. def touchLock(ttlSecs: Int, id: UUID, name: String)(implicit ec: ExecutionContext): Future[Unit]

    Touch the lock with the provided TTL.

    Touch the lock with the provided TTL. This is used by the SingletonManager to keep a lock locked as long as the worker is working.

    ttlSecs
    id
    name
    ec
    returns

  22. def tryLock(ttlSecs: Int, id: UUID, name: String)(implicit ec: ExecutionContext): Future[Boolean]

    Try to acquire a specific lock.

    Try to acquire a specific lock. This uses Cassandra CAS feature to ensure that only one singleton manager can grab the lock.

    Uses cross-data centre serial consistency for now.

    (See https://github.com/soyl/soyl-akka-elect/issues/1)

    ttlSecs
    id
    name
    ec
    returns

  23. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped