pub struct SpawnService { /* private fields */ }Expand description
An HttpService that spawns each request on a separate tokio runtime.
This is useful when the calling runtime (e.g. a CPU-bound DataFusion runtime) may have I/O disabled. All HTTP I/O – including credential refresh – is routed through the provided runtime handle.
§Example
ⓘ
use olai_http::CloudClient;
let io_runtime = tokio::runtime::Runtime::new().unwrap();
let client = CloudClient::new_with_token("tok")
.with_runtime(io_runtime.handle().clone());Implementations§
Source§impl SpawnService
impl SpawnService
pub fn new(inner: Arc<dyn HttpService>, handle: Handle) -> Self
Trait Implementations§
Source§impl Debug for SpawnService
impl Debug for SpawnService
Auto Trait Implementations§
impl !RefUnwindSafe for SpawnService
impl !UnwindSafe for SpawnService
impl Freeze for SpawnService
impl Send for SpawnService
impl Sync for SpawnService
impl Unpin for SpawnService
impl UnsafeUnpin for SpawnService
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