pub struct Isolate<Inner = PipeHandle> {
pub inner: Inner,
pub timeout: Option<Duration>,
pub panic_barrier: bool,
}Expand description
blast-radius barrier around an inner Pipe. enforces:
- time budget —
proxima_core::time::timeoutdrops the inner future and returns 503 when exceeded; the rest of the chain stays healthy. - panic barrier —
catch_unwindconverts a panic in the inner future into a 500 response instead of unwinding through the chain.
either guard is independently optional; with both off this is a pass-through.
generic over the inner handle so the same wrapper composes a Send
inner (PipeHandle, the default — yields impl Handler) or a
per-thread !Send-tolerant inner (ThreadLocalPipeHandle — yields
impl ThreadLocalHandler). The Send variant participates in
cross-thread bootstrap; the per-thread variant lets DPDK / per-core
runtimes hold Rc/RefCell/!Send impl state.
Fields§
§inner: Inner§timeout: Option<Duration>§panic_barrier: boolImplementations§
Source§impl<Inner> Isolate<Inner>
impl<Inner> Isolate<Inner>
pub fn new(inner: Inner) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_panic_barrier(self, enabled: bool) -> Self
Source§impl Isolate<PipeHandle>
impl Isolate<PipeHandle>
pub fn from_spec(inner: PipeHandle, value: &Value) -> Result<Self, ProximaError>
Trait Implementations§
Source§impl Pipe for Isolate<ThreadLocalPipeHandle>
impl Pipe for Isolate<ThreadLocalPipeHandle>
Source§type Err = ProximaError
type Err = ProximaError
Auto Trait Implementations§
impl<Inner> Freeze for Isolate<Inner>where
Inner: Freeze,
impl<Inner> RefUnwindSafe for Isolate<Inner>where
Inner: RefUnwindSafe,
impl<Inner> Send for Isolate<Inner>where
Inner: Send,
impl<Inner> Sync for Isolate<Inner>where
Inner: Sync,
impl<Inner> Unpin for Isolate<Inner>where
Inner: Unpin,
impl<Inner> UnsafeUnpin for Isolate<Inner>where
Inner: UnsafeUnpin,
impl<Inner> UnwindSafe for Isolate<Inner>where
Inner: 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
impl<Implementor> Handler for Implementor
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<P> PipeExt for Pwhere
P: Pipe,
impl<P> PipeExt for Pwhere
P: Pipe,
Source§fn and_then<Next>(self, next: Next) -> AndThen<Self, Next>
fn and_then<Next>(self, next: Next) -> AndThen<Self, Next>
self.and_then(next) is AndThen::new(self, next) — reads
left-to-right at the call site.Source§fn fanout(self, other: Self) -> FanOut<Self, AllOrNothing>
fn fanout(self, other: Self) -> FanOut<Self, AllOrNothing>
Broadcast to
self and other, all-or-nothing.