pub struct FeatureRefresher {
pub unleash_client: Arc<UnleashClient>,
pub tokens_to_refresh: Arc<DashMap<String, TokenRefresh>>,
pub features_cache: Arc<FeatureCache>,
pub delta_cache_manager: Arc<DeltaCacheManager>,
pub engine_cache: Arc<DashMap<String, EngineState>>,
pub refresh_interval: Duration,
pub persistence: Option<Arc<dyn EdgePersistence>>,
pub client_meta_information: ClientMetaInformation,
}
Fields§
§unleash_client: Arc<UnleashClient>
§tokens_to_refresh: Arc<DashMap<String, TokenRefresh>>
§features_cache: Arc<FeatureCache>
§delta_cache_manager: Arc<DeltaCacheManager>
§engine_cache: Arc<DashMap<String, EngineState>>
§refresh_interval: Duration
§persistence: Option<Arc<dyn EdgePersistence>>
§client_meta_information: ClientMetaInformation
Implementations§
Source§impl FeatureRefresher
impl FeatureRefresher
pub fn new( unleash_client: Arc<UnleashClient>, features_cache: Arc<FeatureCache>, delta_cache_manager: Arc<DeltaCacheManager>, engines: Arc<DashMap<String, EngineState>>, persistence: Option<Arc<dyn EdgePersistence>>, config: FeatureRefreshConfig, ) -> Self
pub fn with_client(client: Arc<UnleashClient>) -> Self
Sourcepub async fn register_and_hydrate_token(&self, token: &EdgeToken)
pub async fn register_and_hydrate_token(&self, token: &EdgeToken)
This method no longer returns any data. Its responsibility lies in adding the token to our list of tokens to perform refreshes for, as well as calling out to hydrate tokens that we haven’t seen before. Other tokens will be refreshed due to the scheduled task that refreshes tokens that haven been refreshed in ${refresh_interval} seconds
pub fn features_for_filter( &self, token: EdgeToken, filters: &FeatureFilterSet, ) -> EdgeResult<ClientFeatures>
Sourcepub async fn register_token_for_refresh(
&self,
token: EdgeToken,
etag: Option<EntityTag>,
)
pub async fn register_token_for_refresh( &self, token: EdgeToken, etag: Option<EntityTag>, )
Registers a token for refresh, the token will be discarded if it can be subsumed by another previously registered token
pub async fn hydrate_new_tokens(&self)
pub async fn refresh_features(&self)
pub async fn refresh_single(&self, refresh: TokenRefresh)
Trait Implementations§
Source§impl Clone for FeatureRefresher
impl Clone for FeatureRefresher
Source§fn clone(&self) -> FeatureRefresher
fn clone(&self) -> FeatureRefresher
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for FeatureRefresher
impl !RefUnwindSafe for FeatureRefresher
impl Send for FeatureRefresher
impl Sync for FeatureRefresher
impl Unpin for FeatureRefresher
impl !UnwindSafe for FeatureRefresher
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.