mule/engines/in_memory

Types

pub type Message {
  InsertJob(
    new_job: job.NewJob,
    reply: process.Subject(
      Result(engine.InsertOutcome, engine.EngineError),
    ),
  )
  FetchJobs(
    queue: String,
    limit: Int,
    node: String,
    reply: process.Subject(
      Result(List(job.Job), engine.EngineError),
    ),
  )
  StageJobs(
    limit: Int,
    reply: process.Subject(
      Result(List(String), engine.EngineError),
    ),
  )
  StageScheduled(
    queue: String,
    before: option.Option(timestamp.Timestamp),
    reply: process.Subject(Result(Int, engine.EngineError)),
  )
  CheckAvailable(
    reply: process.Subject(
      Result(List(String), engine.EngineError),
    ),
  )
  PruneJobs(
    max_age: duration.Duration,
    limit: Int,
    reply: process.Subject(Result(Int, engine.EngineError)),
  )
  RescueJobs(
    rescue_after: duration.Duration,
    reply: process.Subject(
      Result(List(engine.AffectedJob), engine.EngineError),
    ),
  )
  GetJob(
    id: Int,
    reply: process.Subject(Result(job.Job, engine.EngineError)),
  )
  CompleteJob(
    id: Int,
    reply: process.Subject(Result(job.Job, engine.EngineError)),
  )
  ErrorJob(
    id: Int,
    error: error.Error,
    delay: duration.Duration,
    reply: process.Subject(Result(job.Job, engine.EngineError)),
  )
  SnoozeJob(
    id: Int,
    delay: duration.Duration,
    reply: process.Subject(Result(job.Job, engine.EngineError)),
  )
  DiscardJob(
    id: Int,
    error: error.Error,
    reply: process.Subject(Result(job.Job, engine.EngineError)),
  )
  CancelJob(
    id: Int,
    error: option.Option(error.Error),
    reply: process.Subject(Result(job.Job, engine.EngineError)),
  )
  InsertAllJobs(
    new_jobs: List(job.NewJob),
    reply: process.Subject(
      Result(List(job.Job), engine.EngineError),
    ),
  )
  AllJobs(
    query: job.Query,
    reply: process.Subject(
      Result(List(job.Job), engine.EngineError),
    ),
  )
  RetryAllJobs(
    query: job.Query,
    reply: process.Subject(
      Result(List(engine.AffectedJob), engine.EngineError),
    ),
  )
  CancelAllJobs(
    query: job.Query,
    reply: process.Subject(
      Result(List(engine.AffectedJob), engine.EngineError),
    ),
  )
  DeleteAllJobs(
    query: job.Query,
    reply: process.Subject(
      Result(List(engine.AffectedJob), engine.EngineError),
    ),
  )
  UpdateJob(
    id: Int,
    updates: List(job.Update),
    reply: process.Subject(Result(job.Job, engine.EngineError)),
  )
}

Constructors

pub type State {
  State(
    jobs_by_id: dict.Dict(Int, job.Job),
    next_id: Int,
    clock: fn() -> timestamp.Timestamp,
  )
}

Constructors

Values

pub fn start_with_clock(
  clock: fn() -> timestamp.Timestamp,
) -> Result(
  actor.Started(process.Subject(Message)),
  actor.StartError,
)
Search Document