pub struct EnginePool { /* private fields */ }Expand description
A pool of engine instances for concurrent execution with memory management
Implementations§
Source§impl EnginePool
impl EnginePool
Sourcepub async fn new(pool_size: usize) -> Result<Self>
pub async fn new(pool_size: usize) -> Result<Self>
Create a new engine pool with the specified size
Sourcepub async fn with_config(
pool_size: usize,
scripts_dir: Option<PathBuf>,
) -> Result<Self>
pub async fn with_config( pool_size: usize, scripts_dir: Option<PathBuf>, ) -> Result<Self>
Create a new engine pool with custom configuration for all instances
Sourcepub fn get_pool_stats(&self) -> PoolStats
pub fn get_pool_stats(&self) -> PoolStats
Get pool statistics
Sourcepub async fn acquire(&self) -> Result<EngineGuard>
pub async fn acquire(&self) -> Result<EngineGuard>
Acquire an engine instance from the pool (blocks if none available)
Sourcepub fn try_acquire(&self) -> Result<Option<EngineGuard>>
pub fn try_acquire(&self) -> Result<Option<EngineGuard>>
Try to acquire an engine instance immediately (non-blocking)
Sourcepub async fn load_scripts_on_all(&self, scripts_dir: &PathBuf) -> Result<()>
pub async fn load_scripts_on_all(&self, scripts_dir: &PathBuf) -> Result<()>
Load scripts on all instances in the pool
Sourcepub async fn load_plan_on_all(&self, plan_path: PathBuf) -> Result<()>
pub async fn load_plan_on_all(&self, plan_path: PathBuf) -> Result<()>
Load a plan on all instances in the pool
Auto Trait Implementations§
impl Freeze for EnginePool
impl !RefUnwindSafe for EnginePool
impl Send for EnginePool
impl Sync for EnginePool
impl Unpin for EnginePool
impl !UnwindSafe for EnginePool
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