pub struct ParallelManager { /* private fields */ }Expand description
Parallel branch manager for tracking and pruning branches
Implementations§
Source§impl ParallelManager
impl ParallelManager
Sourcepub fn new(handle: Arc<SurrealHandle>, config: ParallelConfig) -> Self
pub fn new(handle: Arc<SurrealHandle>, config: ParallelConfig) -> Self
Create a new parallel manager
Sourcepub async fn register_branch(&self, name: &str, commit_id: &str)
pub async fn register_branch(&self, name: &str, commit_id: &str)
Register a branch for tracking
Sourcepub async fn update_score(&self, branch_name: &str, score: f32)
pub async fn update_score(&self, branch_name: &str, score: f32)
Update branch score
Sourcepub async fn update_step(&self, branch_name: &str, step: usize)
pub async fn update_step(&self, branch_name: &str, step: usize)
Update branch step count
Sourcepub async fn get_statuses(&self) -> Vec<BranchStatus>
pub async fn get_statuses(&self) -> Vec<BranchStatus>
Get all branch statuses
Sourcepub async fn prune_low_performing_branches(&self) -> Result<Vec<String>>
pub async fn prune_low_performing_branches(&self) -> Result<Vec<String>>
Prune branches that fall below the score threshold
§TDD: test_optimizer_kills_branch_when_score_threshold_is_missed
Returns the names of pruned branches
Sourcepub async fn active_count(&self) -> usize
pub async fn active_count(&self) -> usize
Get active branch count
Auto Trait Implementations§
impl Freeze for ParallelManager
impl !RefUnwindSafe for ParallelManager
impl Send for ParallelManager
impl Sync for ParallelManager
impl Unpin for ParallelManager
impl UnsafeUnpin for ParallelManager
impl !UnwindSafe for ParallelManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more