Skip to main content

Backlog

Struct Backlog 

Source
pub struct Backlog { /* private fields */ }
Expand description

The table itself. Cloning gives another handle onto the same table, which is how the assembly point can stop what a tool started without either of them knowing about the other. A clone carries scratch too, so it keeps naming that backlog’s directories.

Implementations§

Source§

impl Backlog

Source

pub fn processes(&self) -> Result<BTreeMap<RunId, RunProcesses>, AxError>

The processes of every run that has a command in the table. A command released to nobody belongs to no run.

§Errors

E_STORAGE_FATAL when the table cannot be reached.

Source§

impl Backlog

Source

pub fn new() -> Backlog

Source

pub fn with_window(window: PollBudget) -> Backlog

A table whose callers block for this window before a command is handed to the background.

Source

pub fn with_sink(self, sink: Sink) -> Backlog

The same table, handing what a command writes to sink while the command is still inside its window (crates/runtime/spec/Backlog.lean §8-28-3).

Source

pub fn run( &self, owner: RunId, scope: &Address, what: String, command: Command, ) -> Result<Started, AxError>

Starts a command, waits out the short window, and hands back either its result or a handle onto it.

The command’s program, arguments, working directory and environment are the caller’s; this module owns only where the output goes and how the waiting is done. A command that outlives its window is owed to owner and to no other run.

§Errors

E_TOOL_UNAVAILABLE when the program cannot be started, and E_STORAGE_FATAL when the place its output goes cannot be written.

Source

pub fn enrol_run( &self, scope: &Address, what: String, ) -> Result<BacklogId, AxError>

Enters a run a resident handed down, so a halt on its scope can reach it. The assembly layer calls this before the drive and Backlog::leave after it.

§Errors

E_STORAGE_FATAL when the table cannot be reached.

Source

pub fn stopping(&self, id: BacklogId) -> Result<bool, AxError>

Whether a halt has reached this member. A run asks at each safe point and answers true with Interrupt::Cancel; a member that has already left the table is not stopping, it is gone.

§Errors

E_STORAGE_FATAL when the table cannot be reached.

Source

pub fn leave(&self, id: BacklogId) -> Result<(), AxError>

Takes a run member out once it has frozen. A run that stayed would be reported standing after its own run_frozen line.

§Errors

E_STORAGE_FATAL when the table cannot be reached.

Source

pub fn halt(&self, scope: Option<&Address>) -> Result<usize, AxError>

Stops every member inside a scope, or every member in the city when no scope is named. Returns how many were reached.

A member is stopped where it stands, and the run that started it comes back to its next boundary rather than staying inside a system call. A run member is marked rather than killed: it comes back to its own next safe point and cancels there.

§Errors

E_STORAGE_FATAL when the table cannot be reached, which means a thread died holding it.

Source

pub fn harvest(&self, owner: RunId) -> Result<Vec<Finished>, AxError>

Takes every background member of owner that has stopped, in table order, and lets go of every stopped member whose run has ended.

A member is reported once and then forgotten: this is what a caller appends to the tail of its next tool result, and a result delivered twice would read as the command having run twice. A member another run started is never reported here, because that tail goes into this run’s model and onto its lines of the ledger.

§Errors

E_STORAGE_FATAL when the table cannot be reached.

Source

pub fn release(&self, owner: RunId) -> usize

Terminates every background command owner started, marks each as owed to nobody, and returns how many there were. The run has ended, so no later tool result of its own can carry them; the next harvest by any run lets their process handles and files go without reading their output to anyone.

Infallible by construction: lowering a claim and killing a process hold on any state of the table, so a table a dead thread left locked is still reached, while every other call keeps answering E_STORAGE_FATAL. The caller is a drop, which has nobody to hand a failure to.

Source

pub fn standing(&self, scope: &Address) -> Result<Vec<Standing>, AxError>

What is still running at or under one address.

§Errors

E_STORAGE_FATAL when the table cannot be reached.

Trait Implementations§

Source§

impl Clone for Backlog

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Backlog

Source§

fn default() -> Backlog

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.