pub struct Control { /* private fields */ }Expand description
Commands from the API and signals to the loop.
Implementations§
Source§impl Control
impl Control
Sourcepub fn new(
repositories: impl IntoIterator<Item = String>,
) -> (Control, Commands)
pub fn new( repositories: impl IntoIterator<Item = String>, ) -> (Control, Commands)
Controls for the configured repositories, and the commands they send the engine.
Sourcepub fn set_paused(&self, repository: &str, paused: bool) -> bool
pub fn set_paused(&self, repository: &str, paused: bool) -> bool
Pauses or resumes a repository whatever it runs; false if it is not configured.
Sourcepub fn shutdown(&self, jobs: RunningJobs)
pub fn shutdown(&self, jobs: RunningJobs)
Asks the loop to stop; a forced request overrides a graceful one, never the other way.
Sourcepub async fn pause(
&self,
repository: &str,
jobs: RunningJobs,
) -> Result<Paused, ControlError>
pub async fn pause( &self, repository: &str, jobs: RunningJobs, ) -> Result<Paused, ControlError>
Pauses a repository. With RunningJobs::Keep, refuses while it runs a job; with Kill, cancels the runs of
its running jobs on GitHub, whose runners are removed once they report it or CANCEL_GRACE later, and
removes its other runners at once.
Sourcepub async fn reseed(&self, profile: &str) -> Result<(), ControlError>
pub async fn reseed(&self, profile: &str) -> Result<(), ControlError>
Reseeds a profile as soon as its slots are free; none of them starts a runner until then.
Sourcepub async fn clean_cache(&self, name: &str) -> Result<(), ControlError>
pub async fn clean_cache(&self, name: &str) -> Result<(), ControlError>
Removes a slot’s volume or a shared cache’s, unless a runner uses it.
Sourcepub async fn replace_config(
&self,
config: Config,
memory_max: Option<u64>,
commit: Commit,
) -> Result<Option<String>, ControlError>
pub async fn replace_config( &self, config: Config, memory_max: Option<u64>, commit: Commit, ) -> Result<Option<String>, ControlError>
Runs commit to write a validated config, and if it commits, runs with the config from then on, before the
next tick. If it does not, nothing changes and the answer is Failed. Running jobs keep running: removed
profiles and slots go as their runners finish.