pub struct Runner { /* private fields */ }
Expand description
Runner for gitlab
The runner is responsible for communicating with gitlab to request new job and spawn them.
Implementations§
Source§impl Runner
impl Runner
Sourcepub async fn request_job<F, J, U, Ret>(
&mut self,
process: F,
) -> Result<bool, Error>
pub async fn request_job<F, J, U, Ret>( &mut self, process: F, ) -> Result<bool, Error>
Try to request a single job from gitlab
This does a single poll of gitlab for a new job. If a new job received a new asynchronous
task is spawned for processing the job. The passed process
function is called to create a
the actual job handler. Returns whether or not a job was received or an error if polling
gitlab failed.
Note that this function is not cancel safe. If the future gets cancelled gitlab might have provided a job for which processing didn’t start yet.
Sourcepub async fn wait_for_space(&mut self, max: usize)
pub async fn wait_for_space(&mut self, max: usize)
Wait untill there are less then max jobs running
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Runner
impl !RefUnwindSafe for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl !UnwindSafe for Runner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more