pub struct RunControl { /* private fields */ }Expand description
Graceful shutdown control for Pregel execution
Allows external callers to request drain (finish current tasks but don’t start new ones).
Checked in PregelLoop::tick() before computing next tasks.
§Examples
ⓘ
use juncture_core::pregel::loop_::RunControl;
let run_control = RunControl::new();
// Request drain from another thread
let rc_clone = run_control.clone();
std::thread::spawn(move || {
// After some condition, request drain
rc_clone.request_drain();
});
// In the main loop
if run_control.is_drain_requested() {
// Finish current tasks but don't start new ones
}Implementations§
Source§impl RunControl
impl RunControl
Sourcepub fn request_drain(&self)
pub fn request_drain(&self)
Sourcepub fn is_drain_requested(&self) -> bool
pub fn is_drain_requested(&self) -> bool
Trait Implementations§
Source§impl Clone for RunControl
impl Clone for RunControl
Source§fn clone(&self) -> RunControl
fn clone(&self) -> RunControl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RunControl
impl Debug for RunControl
Auto Trait Implementations§
impl Freeze for RunControl
impl RefUnwindSafe for RunControl
impl Send for RunControl
impl Sync for RunControl
impl Unpin for RunControl
impl UnsafeUnpin for RunControl
impl UnwindSafe for RunControl
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