pub struct ParamManager { /* private fields */ }Expand description
Manager for optimized parameters with caching and updates
Implementations§
Source§impl ParamManager
impl ParamManager
Sourcepub fn updates_channel(&self) -> String
pub fn updates_channel(&self) -> String
Get the param updates channel name
Sourcepub fn params_hash_key(&self) -> String
pub fn params_hash_key(&self) -> String
Get the params hash key
Sourcepub fn subscribe(&self) -> Receiver<ParamNotification>
pub fn subscribe(&self) -> Receiver<ParamNotification>
Subscribe to param update notifications
Sourcepub async fn get(&self, asset: &str) -> Option<OptimizedParams>
pub async fn get(&self, asset: &str) -> Option<OptimizedParams>
Get params for an asset (from cache)
Sourcepub async fn get_all(&self) -> HashMap<String, OptimizedParams>
pub async fn get_all(&self) -> HashMap<String, OptimizedParams>
Get all cached params
Sourcepub async fn update(&self, params: OptimizedParams)
pub async fn update(&self, params: OptimizedParams)
Update params for an asset
Sourcepub async fn load_from_redis(
&self,
client: &Client,
) -> Result<usize, ParamError>
pub async fn load_from_redis( &self, client: &Client, ) -> Result<usize, ParamError>
Load all params from Redis
Sourcepub async fn process_notification(&self, json: &str) -> Result<(), ParamError>
pub async fn process_notification(&self, json: &str) -> Result<(), ParamError>
Process a notification from Redis pub/sub
Auto Trait Implementations§
impl Freeze for ParamManager
impl !RefUnwindSafe for ParamManager
impl Send for ParamManager
impl Sync for ParamManager
impl Unpin for ParamManager
impl UnsafeUnpin for ParamManager
impl !UnwindSafe for ParamManager
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