pub struct ThreadDispatch(/* private fields */);Expand description
The dispatcher every desktop build runs: one worker thread per request,
blocked in HttpClient::send until the reply lands.
A thread per request suits the usual “a few API calls per UI action” workload; a pool can replace it behind the same trait if that stops being true.
A platform with no threads cannot run this one, and up front is the only
place to say so: std::thread::Builder::spawn consumes the completion
callback, so a failed spawn leaves nothing to report the failure through.
Such a platform gets an error naming what it should install instead, which
is what a browser build sees until lumen-web-http goes in.
Implementations§
Source§impl ThreadDispatch
impl ThreadDispatch
Sourcepub fn new(client: Arc<dyn HttpClient>) -> Self
pub fn new(client: Arc<dyn HttpClient>) -> Self
Run every dispatched request on client.
Trait Implementations§
Source§impl HttpDispatch for ThreadDispatch
impl HttpDispatch for ThreadDispatch
Auto Trait Implementations§
impl Freeze for ThreadDispatch
impl !RefUnwindSafe for ThreadDispatch
impl Send for ThreadDispatch
impl Sync for ThreadDispatch
impl Unpin for ThreadDispatch
impl UnsafeUnpin for ThreadDispatch
impl !UnwindSafe for ThreadDispatch
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.