pub struct Layover {
pub id: LayoverId,
pub agent: AgentName,
pub booked_by: ItineraryId,
pub waiting_for: String,
pub handover: Handover,
pub booked_at: Timestamp,
pub due_at: Timestamp,
pub checks: u32,
pub max_checks: u32,
pub standing: Standing,
}Expand description
Work set down now to be picked up later.
Fields§
§id: LayoverIdIdentifier.
agent: AgentNameWhich agent the resumed work should go to.
booked_by: ItineraryIdThe itinerary that booked it.
waiting_for: StringOne line saying what this is waiting for, for a human reading a list.
handover: HandoverWhat the resumed run needs to know.
booked_at: TimestampWhen it was booked.
due_at: TimestampThe soonest it should be picked up.
checks: u32How many times it has been picked up and set down again.
A layover waiting on a human is checked repeatedly and usually finds nothing. Counting gives the difference between “waiting patiently” and “waiting forever”, which is the difference between a follow-up and a leak.
max_checks: u32How many checks it may have before it is given up on.
standing: StandingWhere it has got to.
Implementations§
Source§impl Layover
impl Layover
Sourcepub fn book(
agent: AgentName,
booked_by: ItineraryId,
waiting_for: impl Into<String>,
handover: Handover,
booked_at: Timestamp,
due_at: Timestamp,
max_checks: u32,
) -> Self
pub fn book( agent: AgentName, booked_by: ItineraryId, waiting_for: impl Into<String>, handover: Handover, booked_at: Timestamp, due_at: Timestamp, max_checks: u32, ) -> Self
Books a layover.
Sourcepub fn is_due(&self, now: Timestamp) -> bool
pub fn is_due(&self, now: Timestamp) -> bool
Returns true when this should be picked up at now.
Sourcepub fn set_down_again(&mut self, now: Timestamp)
pub fn set_down_again(&mut self, now: Timestamp)
Records that it was picked up and the thing it waits for had not happened.
Each check pushes the next one further out, so a layover waiting on a human does not poll at the same rate on day six as on minute one. Backing off is what makes a long wait affordable — the alternative is paying for a run every few minutes to be told nothing has changed.
Sourcepub fn minutes_until_due(&self, now: Timestamp) -> Option<i64>
pub fn minutes_until_due(&self, now: Timestamp) -> Option<i64>
How long until it is next due, in whole minutes, or None when it is due now.