Packages

trait JobManager[M[+_]] extends AnyRef

Self Type
JobManager[M]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JobManager
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def abort(job: JobId, reason: String, abortedAt: LocalDateTime = LocalDateTime.now): M[Either[String, Job]]

    Aborts a job by putting it into the Aborted state.

    Aborts a job by putting it into the Aborted state. This is a terminal state.

  2. abstract def addMessage(job: JobId, channel: ChannelId, value: JValue): M[Message]

    Add a message to a job's channel.

    Add a message to a job's channel. If the channel does not exist, it will be created.

  3. abstract def cancel(job: JobId, reason: String, cancelledAt: LocalDateTime = LocalDateTime.now): M[Either[String, Job]]

    Cancels a job.

    Cancels a job. This doesn't necessarily mean the job has actually stopped, it is just used to let the worker know a cancellation was requested. It is up to the worker to abort the job. A cancelled job may still be completed normally or aborted for other reasons than the cancellation. The reason should give a useful string about why the cancellation was requested (eg. "User action." or "Server restart.").

  4. abstract def createJob(name: String, jobType: String, data: Option[JValue], started: Option[LocalDateTime]): M[Job]

    Create a new Job with the given API key, name, type and possibly an initial status message and expiration.

    Create a new Job with the given API key, name, type and possibly an initial status message and expiration. If a started time is provided, then the job will be put in the Started state, otherwise it will be in the NotStarted state until start(...) is run.

  5. abstract def expire(job: JobId, expiredAt: LocalDateTime = LocalDateTime.now): M[Either[String, Job]]

    Moves the job to the Expired terminal state.

  6. abstract def findJob(job: JobId): M[Option[Job]]

    Returns the Job with the given ID if it exists.

  7. abstract def finish(job: JobId, finishedAt: LocalDateTime = LocalDateTime.now): M[Either[String, Job]]

    Moves the job to the Finished terminal state, with the given value as the result.

  8. abstract def getResult(job: JobId): M[Either[String, (Option[MimeType], StreamT[M, Array[Byte]])]]
  9. abstract def getStatus(job: JobId): M[Option[Status]]

    Returns just the latest status message.

  10. abstract def listChannels(job: JobId): M[Seq[ChannelId]]

    Lists all channels that have had messages posted to them.

    Lists all channels that have had messages posted to them. Note that channels are created on a demand by addMessage, so this is not a definitive list of channels, just what existed at the time.

  11. abstract def listJobs: M[Seq[Job]]

    Returns a list of all currently running jobs

  12. abstract def listMessages(job: JobId, channel: ChannelId, since: Option[MessageId]): M[Seq[Message]]

    Returns all the messages posted to a job's channel since some specified message.

    Returns all the messages posted to a job's channel since some specified message. If no previous message is given, then all messages posted to the given channel are returned.

  13. abstract def setResult(job: JobId, mimeType: Option[MimeType], data: StreamT[M, Array[Byte]]): M[Either[String, Unit]]
  14. abstract def start(job: JobId, startedAt: LocalDateTime = LocalDateTime.now): M[Either[String, Job]]

    Starts a job if it is in the NotStarted state, otherwise an error string is returned.

  15. abstract def updateStatus(job: JobId, prevStatus: Option[StatusId], msg: String, progress: BigDecimal, unit: String, extra: Option[JValue]): M[Either[String, Status]]

    Updates a job's status to value.

    Updates a job's status to value. If a prevStatus is provided, then this must match the current status in order for the update to succeed, otherwise the update fails and the actual current status is returned.

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
    @native() @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
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  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
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  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
    @native() @throws( ... )
  20. def withM[N[+_]](implicit t: ~>[M, N], u: ~>[N, M], M: Monad[M], N: Monad[N]): JobManager[N]

Inherited from AnyRef

Inherited from Any

Ungrouped