Struct portier::MemoryStore
source · pub struct MemoryStore<C> { /* private fields */ }
Expand description
A Store
implementation that keeps everything in-memory.
This is the default Store
implementation if a Client
is used without explicitely
configuring one.
Note that the cache in this store only grows. For clients that only talk to a trusted broker (the default), this is fine, because it can be assumed only a couple of URLs are fetched periodically.
This store will only function correctly if the application is a single process. When running multiple workers, the different processes will not be able to recognize eachothers’ sessions.
Restarting the application process will also cause a complete loss of all sessions. For low traffic sites, this may be fine, because sessions are short-lived.
Implementations§
source§impl<C> MemoryStore<C>
impl<C> MemoryStore<C>
sourcepub fn with_http_client(client: C, timeout: Duration) -> Self
pub fn with_http_client(client: C, timeout: Duration) -> Self
Create a store with a custom HTTP client configuration.
If defaults are fine, use the Default
implementation instead.