trait JobManager[M[+_]] extends AnyRef
- Self Type
- JobManager[M]
- Alphabetic
- By Inheritance
- JobManager
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
abort(job: JobId, reason: String, abortedAt: LocalDateTime = LocalDateTime.now): M[Either[String, Job]]
Aborts a job by putting it into the
Abortedstate.Aborts a job by putting it into the
Abortedstate. This is a terminal state. -
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.
-
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.").
-
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. -
abstract
def
expire(job: JobId, expiredAt: LocalDateTime = LocalDateTime.now): M[Either[String, Job]]
Moves the job to the
Expiredterminal state. -
abstract
def
findJob(job: JobId): M[Option[Job]]
Returns the Job with the given ID if it exists.
-
abstract
def
finish(job: JobId, finishedAt: LocalDateTime = LocalDateTime.now): M[Either[String, Job]]
Moves the job to the
Finishedterminal state, with the given value as the result. - abstract def getResult(job: JobId): M[Either[String, (Option[MimeType], StreamT[M, Array[Byte]])]]
-
abstract
def
getStatus(job: JobId): M[Option[Status]]
Returns just the latest status message.
-
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. -
abstract
def
listJobs: M[Seq[Job]]
Returns a list of all currently running jobs
-
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.
- abstract def setResult(job: JobId, mimeType: Option[MimeType], data: StreamT[M, Array[Byte]]): M[Either[String, Unit]]
-
abstract
def
start(job: JobId, startedAt: LocalDateTime = LocalDateTime.now): M[Either[String, Job]]
Starts a job if it is in the
NotStartedstate, otherwise an error string is returned. -
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 aprevStatusis 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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def withM[N[+_]](implicit t: ~>[M, N], u: ~>[N, M], M: Monad[M], N: Monad[N]): JobManager[N]