module

Feed::Queue

The judge queue.

Constants

Log = ::Log.for(self)

Class methods

backfill_cap

The number of questions beyond which backfill is refused.

Source
backfill_cap=(backfill_cap : Int32)

The number of questions beyond which backfill is refused.

Source
live_cap

The number of questions beyond which anything is refused.

Source
live_cap=(live_cap : Int32)

The number of questions beyond which anything is refused.

Source
page_size

The number of candidates read at a time.

Source
page_size=(page_size : Int32)

The number of candidates read at a time.

Source

Instance methods

enqueue(version_id : Int64, object_iri : String, live : Bool, due_at : Time = Time.utc) : Nil

Enqueues a question.

A question for a pair that is already waiting coalesces into the waiting question.

Raises FullError if the queue is full.

Source
enqueue_arrival(object : ActivityPub::Object) : Nil

Enqueues an object as a live question for every registered feed's version it is a candidate for.

Sheds the question, with a warning, if the queue is full.

Source
enqueue_backfill(feed : Feed, limit : Int32 | Nil = nil, live : Bool = false) : Bool

Enqueues a feed's candidates, newest first.

Enqueues nothing if a page of the version's questions is already queued.

Returns true if there is more to enqueue later.

Source
finish(question : Question) : Nil

Removes an answered question.

Source
pause(name : String, until time : Time) : Nil

Pauses a judge until until.

Source
paused(now : Time = Time.utc) : Array(String)

Returns the judges paused at now.

Source
paused_until(name : String) : Time | Nil

Returns when a judge's pause ends, or nil if it isn't paused.

Source
pull(now : Time = Time.utc) : Array(Question)

Pulls the next batch of questions that are due.

The batch is the next question to pull and the questions after it on the same version, up to its judge's batch size. Questions on a paused judge's versions are not pulled.

Source
release_batches

Returns every question in a batch to waiting.

Each is enqueued again, so duplicates coalesce.

The cap does not apply.

Source
requeue(version_id : Int64, object_iri : String, live : Bool, due_at : Time) : Nil

Enqueues a question again, to be asked later.

The cap does not apply.

Source
resume(name : String) : Nil

Resumes a paused judge.

Source

Nested types