pub struct ExecutorService<S, E> { /* private fields */ }Expand description
A service that delegates request processing to an executor.
Each request is spawned as a new task on the executor, allowing parallel processing of multiple requests.
§Requirements
The inner service must implement Clone so that each spawned task
can have its own instance. This is the standard pattern for Tower
services that need to be shared across tasks.
§Cancellation
When the response future is dropped, the spawned task continues to run to completion. This is intentional to avoid partial processing. If you need cancellation, consider wrapping with a timeout layer.
Implementations§
Source§impl<S, E> ExecutorService<S, E>
impl<S, E> ExecutorService<S, E>
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes the service and returns the inner service.
Trait Implementations§
Source§impl<S: Clone, E: Clone> Clone for ExecutorService<S, E>
impl<S: Clone, E: Clone> Clone for ExecutorService<S, E>
Source§fn clone(&self) -> ExecutorService<S, E>
fn clone(&self) -> ExecutorService<S, E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S, E, Req> Service<Req> for ExecutorService<S, E>
impl<S, E, Req> Service<Req> for ExecutorService<S, E>
Auto Trait Implementations§
impl<S, E> Freeze for ExecutorService<S, E>
impl<S, E> RefUnwindSafe for ExecutorService<S, E>where
S: RefUnwindSafe,
E: RefUnwindSafe,
impl<S, E> Send for ExecutorService<S, E>
impl<S, E> Sync for ExecutorService<S, E>
impl<S, E> Unpin for ExecutorService<S, E>
impl<S, E> UnsafeUnpin for ExecutorService<S, E>where
S: UnsafeUnpin,
E: UnsafeUnpin,
impl<S, E> UnwindSafe for ExecutorService<S, E>where
S: UnwindSafe,
E: UnwindSafe,
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