Packages

abstract class WorkItemModuleRepository[T] extends WorkItemRepository[T]

If you have multiple lifecycles on a WorkItem, you can use the WorkItemModuleRepository to interact with those lifecycles. It will namespace the lifecycle fields with the provided moduleName. It assumes creation of WorkItems are made through another view (e.g. a standard WorkItemRepository), it will only allow interacting with the WorkItem lifecycle, and will throw runtime exceptions if pushNew or pushNewBatch are called.

Linear Supertypes
WorkItemRepository[T], MetricSource, FindById[T], Cancel, PlayMongoRepository[WorkItem[T]], MongoDatabaseCollection, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WorkItemModuleRepository
  2. WorkItemRepository
  3. MetricSource
  4. FindById
  5. Cancel
  6. PlayMongoRepository
  7. MongoDatabaseCollection
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new WorkItemModuleRepository(collectionName: String, moduleName: String, mongoComponent: MongoComponent, replaceIndexes: Boolean = true)(implicit trd: Reads[T], ec: ExecutionContext)

Abstract Value Members

  1. abstract def inProgressRetryAfter: Duration

    Returns the timeout of any WorkItems marked as InProgress.

    Returns the timeout of any WorkItems marked as InProgress. WorkItems marked as InProgress will be hidden from pullOutstanding until this window expires.

    Definition Classes
    WorkItemRepository
  2. abstract def now(): Instant

    Returns the current date time for setting the updatedAt field.

    Returns the current date time for setting the updatedAt field. abstract to allow for test friendly implementations.

    Definition Classes
    WorkItemRepository

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 cancel(id: ObjectId): Future[StatusUpdateResult]

    Sets the ProcessingStatus of a WorkItem to Cancelled.

    Sets the ProcessingStatus of a WorkItem to Cancelled.

    returns

    StatusUpdateResult.Updated if the WorkItem is cancelled, StatusUpdateResult.NotFound if it's not found, and StatusUpdateResult.NotUpdated if it's not in a cancellable ProcessingStatus.

    Definition Classes
    WorkItemRepositoryCancel
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. lazy val collection: MongoCollection[WorkItem[T]]
    Definition Classes
    PlayMongoRepository
  8. final val collectionName: String
    Definition Classes
    PlayMongoRepository → MongoDatabaseCollection
  9. def complete(id: ObjectId, newStatus: ResultStatus): Future[Boolean]

    Sets the ProcessingStatus of a WorkItem to a ResultStatus.

    Sets the ProcessingStatus of a WorkItem to a ResultStatus. It will also update the updatedAt timestamp. It will return false if the WorkItem is not InProgress.

    Definition Classes
    WorkItemRepository
  10. def completeAndDelete(id: ObjectId): Future[Boolean]

    Deletes the WorkItem.

    Deletes the WorkItem. It will return false if the WorkItem is not InProgress.

    Definition Classes
    WorkItemRepository
  11. def count(state: ProcessingStatus): Future[Long]

    Returns the number of WorkItems in the specified ProcessingStatus

    Returns the number of WorkItems in the specified ProcessingStatus

    Definition Classes
    WorkItemRepository
  12. final val domainFormat: Format[WorkItem[T]]
    Definition Classes
    PlayMongoRepository
  13. def ensureIndexes: Future[Seq[String]]
    Definition Classes
    PlayMongoRepository
  14. def ensureSchema: Future[Unit]
    Definition Classes
    PlayMongoRepository
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  18. def findById(id: ObjectId): Future[Option[WorkItem[T]]]
    Definition Classes
    WorkItemRepositoryFindById
  19. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. final val indexes: Seq[IndexModel]
    Definition Classes
    PlayMongoRepository → MongoDatabaseCollection
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def markAs(id: ObjectId, status: ProcessingStatus, availableAt: Option[Instant] = None): Future[Boolean]

    Sets the ProcessingStatus of a WorkItem.

    Sets the ProcessingStatus of a WorkItem. It will also update the updatedAt timestamp.

    Definition Classes
    WorkItemRepository
  24. lazy val metricPrefix: String
  25. def metrics(implicit ec: ExecutionContext): Future[Map[String, Int]]
    Definition Classes
    WorkItemRepository → MetricSource
  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. final val optSchema: Option[BsonDocument]
    Definition Classes
    PlayMongoRepository
  30. def pullOutstanding(failedBefore: Instant, availableBefore: Instant): Future[Option[WorkItem[T]]]

    Returns a WorkItem to be processed, if available.

    Returns a WorkItem to be processed, if available. The item will be atomically set to ProcessingStatus.InProgress, so it will not be picked up by other calls to pullOutstanding until it's status has been explicitly marked as Failed or ToDo, or it's progress status has timed out (set by inProgressRetryAfter).

    A WorkItem will be considered for processing in the following order: 1) Has ToDo status, and the availableAt field is before the availableBefore param. 2) Has Failed status, and it was marked as Failed before the failedBefore param. 3) Has InProgress status, and was marked as InProgress before the inProgressRetryAfter configuration. Basically a timeout to ensure WorkItems that don't advance from InProgress do not get stuck.

    failedBefore

    it will only consider WorkItems in FailedState if they were marked as Failed before the failedBefore. This can avoid retrying a failure immediately.

    availableBefore

    it will only consider WorkItems where the availableAt field is before the availableBefore

    Definition Classes
    WorkItemRepository
  31. def pushNew(item: T, availableAt: Instant, initialState: (T) => ProcessingStatus): Future[WorkItem[T]]

    Creates a new WorkItem.

    Creates a new WorkItem.

    item

    the item to store in the WorkItem

    availableAt

    when to defer processing until

    initialState

    defines the initial state of the WorkItem for the item

    Definition Classes
    WorkItemModuleRepositoryWorkItemRepository
  32. def pushNewBatch(items: Seq[T], availableAt: Instant, initialState: (T) => ProcessingStatus): Future[Seq[WorkItem[T]]]

    Creates a batch of new WorkItems.

    Creates a batch of new WorkItems.

    items

    the items to store as WorkItems

    availableAt

    when to defer processing until

    initialState

    defines the initial state of the WorkItems for the item

    Definition Classes
    WorkItemModuleRepositoryWorkItemRepository
  33. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  34. def toString(): String
    Definition Classes
    AnyRef → Any
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  38. val workItemFields: WorkItemFields
    Definition Classes
    WorkItemRepository

Inherited from WorkItemRepository[T]

Inherited from MetricSource

Inherited from FindById[T]

Inherited from Cancel

Inherited from PlayMongoRepository[WorkItem[T]]

Inherited from MongoDatabaseCollection

Inherited from AnyRef

Inherited from Any

Ungrouped