pub struct EnginePool { /* private fields */ }Expand description
A pool of Fusabi engines for concurrent execution.
The pool manages a fixed number of engines and provides thread-safe access to them for parallel script execution.
Implementations§
Source§impl EnginePool
impl EnginePool
Sourcepub fn new(config: PoolConfig) -> Result<Self>
pub fn new(config: PoolConfig) -> Result<Self>
Create a new engine pool with the given configuration.
Sourcepub fn acquire(&self) -> Result<PoolHandle>
pub fn acquire(&self) -> Result<PoolHandle>
Acquire an engine from the pool.
Blocks until an engine is available or the timeout expires.
Sourcepub fn try_acquire(&self) -> Result<PoolHandle>
pub fn try_acquire(&self) -> Result<PoolHandle>
Try to acquire an engine without blocking.
Sourcepub fn execute(&self, source: &str) -> Result<Value>
pub fn execute(&self, source: &str) -> Result<Value>
Execute source code using a pooled engine.
Convenience method that acquires an engine, executes, and returns it.
Sourcepub fn execute_bytecode(&self, bytecode: &[u8]) -> Result<Value>
pub fn execute_bytecode(&self, bytecode: &[u8]) -> Result<Value>
Execute bytecode using a pooled engine.
Sourcepub fn config(&self) -> &PoolConfig
pub fn config(&self) -> &PoolConfig
Get the pool configuration.
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Check if the pool is healthy.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Check if the pool has been shut down.
Trait Implementations§
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