pub struct ScatterProxy { /* private fields */ }Expand description
The main entry point. Manages proxy pool, scheduling, and background tasks.
Implementations§
Source§impl ScatterProxy
impl ScatterProxy
Sourcepub async fn new(
config: ScatterProxyConfig,
classifier: impl BodyClassifier,
) -> Result<Self, ScatterProxyError>
pub async fn new( config: ScatterProxyConfig, classifier: impl BodyClassifier, ) -> Result<Self, ScatterProxyError>
Create a new ScatterProxy from config and a body classifier.
This is an async constructor that fetches proxies, restores persisted state, and spawns all background tasks (scheduler, persistence, metrics logging, source refresh).
Sourcepub fn submit(&self, request: Request) -> Result<TaskHandle, ScatterProxyError>
pub fn submit(&self, request: Request) -> Result<TaskHandle, ScatterProxyError>
Submit a single request for proxied execution.
Returns a TaskHandle that implements Future and resolves to the
proxied response (or an error).
Sourcepub fn submit_batch(
&self,
requests: Vec<Request>,
) -> Result<Vec<TaskHandle>, ScatterProxyError>
pub fn submit_batch( &self, requests: Vec<Request>, ) -> Result<Vec<TaskHandle>, ScatterProxyError>
Submit a batch of requests for proxied execution.
All requests are added atomically — if the pool doesn’t have enough capacity the entire batch is rejected.
Sourcepub fn metrics(&self) -> PoolMetrics
pub fn metrics(&self) -> PoolMetrics
Build a PoolMetrics snapshot from all internal components.
Auto Trait Implementations§
impl Freeze for ScatterProxy
impl !RefUnwindSafe for ScatterProxy
impl Send for ScatterProxy
impl Sync for ScatterProxy
impl Unpin for ScatterProxy
impl UnsafeUnpin for ScatterProxy
impl !UnwindSafe for ScatterProxy
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