pub struct ParallelExecutor { /* private fields */ }Expand description
Block-STM inspired parallel transaction executor.
Executes batches of operations in parallel with optimistic concurrency control.
Implementations§
Source§impl ParallelExecutor
impl ParallelExecutor
Sourcepub fn new(num_workers: usize) -> Self
pub fn new(num_workers: usize) -> Self
Creates a new parallel executor with the specified number of workers.
§Panics
Panics if num_workers is 0.
Sourcepub fn default_workers() -> Self
pub fn default_workers() -> Self
Creates a parallel executor with the default number of workers (number of CPUs).
Sourcepub fn num_workers(&self) -> usize
pub fn num_workers(&self) -> usize
Returns the number of workers.
Sourcepub fn execute_batch<F>(
&self,
batch: BatchRequest,
execute_fn: F,
) -> BatchResult
pub fn execute_batch<F>( &self, batch: BatchRequest, execute_fn: F, ) -> BatchResult
Executes a batch of operations in parallel.
Operations are executed optimistically in parallel, validated for conflicts, and re-executed as needed. The final result maintains deterministic ordering.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParallelExecutor
impl !RefUnwindSafe for ParallelExecutor
impl Send for ParallelExecutor
impl Sync for ParallelExecutor
impl Unpin for ParallelExecutor
impl !UnwindSafe for ParallelExecutor
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