pub struct CachePeekStaleService { /* private fields */ }Expand description
Outcome-aware segment that serves a stale (post-expiry) cache entry.
Evaluates key_expr:
None→Stopped(exchange)with adebuglog (an anomalous key resolution is fail-closed, not a miss).Some(key)→repository.peek_stale(&key).await.Err(e)→Failed(e).Ok(Some(entry))→ reconstruct body from entry, setCamelCachePeekHit=trueandCamelCachePeekStale(true when the entry’sexpires_athas elapsed at evaluation time; false when absent or not elapsed), returnCompleted(exchange).Ok(None)→ MISS (absence), governed byPeekStaleMissPolicy:Stop(default): setCamelCachePeekHit=falseandCamelCachePeekStale=false, log atdebug, returnStopped(exchange)(absence inCircuitBreaker.fallbackmeans “no stale available”).Continue: setCamelCachePeekHit=falseandCamelCachePeekStale=false, leave the body unchanged, returnCompleted(exchange)sochoicecan branch onCamelCachePeekHit.
Implementations§
Source§impl CachePeekStaleService
impl CachePeekStaleService
pub fn new( repository: Arc<dyn CacheRepository>, key_expr: MessageIdExpression, miss_policy: PeekStaleMissPolicy, ) -> Self
Trait Implementations§
Source§impl Clone for CachePeekStaleService
impl Clone for CachePeekStaleService
Source§impl OutcomePipeline for CachePeekStaleService
impl OutcomePipeline for CachePeekStaleService
Source§fn clone_box(&self) -> Box<dyn OutcomePipeline>
fn clone_box(&self) -> Box<dyn OutcomePipeline>
Clone the segment into a new boxed instance. Required because
Box<dyn OutcomePipeline> cannot directly derive Clone.Auto Trait Implementations§
impl !RefUnwindSafe for CachePeekStaleService
impl !UnwindSafe for CachePeekStaleService
impl Freeze for CachePeekStaleService
impl Send for CachePeekStaleService
impl Sync for CachePeekStaleService
impl Unpin for CachePeekStaleService
impl UnsafeUnpin for CachePeekStaleService
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