pub struct AdaptiveTracker { /* private fields */ }Expand description
Adaptive tracker that switches between table and row-level tracking.
When few subscriptions exist for a table, track at row level. When many subscriptions exist, switch to table level.
Implementations§
Source§impl AdaptiveTracker
impl AdaptiveTracker
Sourcepub fn new(config: AdaptiveTrackingConfig) -> Self
pub fn new(config: AdaptiveTrackingConfig) -> Self
Create a new adaptive tracker.
Sourcepub async fn record_subscription(
&self,
table: &str,
row_ids: Option<Vec<String>>,
)
pub async fn record_subscription( &self, table: &str, row_ids: Option<Vec<String>>, )
Record a subscription for a table.
Sourcepub async fn remove_subscription(
&self,
table: &str,
row_ids: Option<Vec<String>>,
)
pub async fn remove_subscription( &self, table: &str, row_ids: Option<Vec<String>>, )
Remove a subscription.
Sourcepub async fn evaluate_table(&self, table: &str)
pub async fn evaluate_table(&self, table: &str)
Evaluate and potentially switch tracking mode for a table.
Sourcepub async fn should_invalidate(&self, table: &str, row_id: &str) -> bool
pub async fn should_invalidate(&self, table: &str, row_id: &str) -> bool
Check if a change should be invalidated.
Sourcepub async fn get_mode(&self, table: &str) -> TrackingMode
pub async fn get_mode(&self, table: &str) -> TrackingMode
Get the current tracking mode for a table.
Sourcepub async fn stats(&self) -> AdaptiveTrackingStats
pub async fn stats(&self) -> AdaptiveTrackingStats
Get tracking statistics.
Auto Trait Implementations§
impl !Freeze for AdaptiveTracker
impl !RefUnwindSafe for AdaptiveTracker
impl Send for AdaptiveTracker
impl Sync for AdaptiveTracker
impl Unpin for AdaptiveTracker
impl !UnwindSafe for AdaptiveTracker
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
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more