package lock
- Alphabetic
- Public
- Protected
Type Members
- case class Lock(id: String, owner: String, timeCreated: Instant, expiryTime: Instant) extends Product with Serializable
- trait LockRepository extends AnyRef
- Annotations
- @ImplementedBy()
- trait LockService extends AnyRef
For locking for a particular task.
For locking for a particular task. The lock will be released when the task has finished.
- class MongoLockRepository extends PlayMongoRepository[Lock] with LockRepository
- Annotations
- @Singleton()
- trait ScheduledLockService extends AnyRef
A locking implementation for scheduled tasks that will only execute the
bodywhen a new lock has been acquired.A locking implementation for scheduled tasks that will only execute the
bodywhen a new lock has been acquired.The lock's ttl is set to be
schedulerInterval+ 1 second, meaning that the instance that currently owns the lock will always have a chance to refresh the lock and extend the ttl.If the lock is successfully refreshed, then
bodywill not be executed, as being able to refresh the lock signals that thebodyof the previous invocation hasn't yet completed.Once the
bodyhas completed it will either:- Release the lock immediately, when the
bodyhas taken longer than theschedulerIntervalto complete - Disown the lock and amend the ttl to reflect the cadence of the scheduled task
In the event that the scheduled task ends in failure, the lock will be released immediately.
- Release the lock immediately, when the
- trait TimePeriodLockService extends AnyRef
For locking for a give time period (i.e.
For locking for a give time period (i.e. stop other instances executing the task until it stops renewing the lock). The lock will be held on to when the task has finished, until it expires.
Value Members
- object Lock extends Serializable
- object LockService
- object ScheduledLockService
- object TimePeriodLockService