pub struct RedisLocalSnapshot {
pub redis_addr: SocketAddr,
pub aof_path: PathBuf,
pub timeout: Duration,
pub bgrewrite_retries: u32,
pub bgrewrite_retry_pause: Duration,
}Expand description
Default snapshot source: pulls a Redis snapshot from a local Redis instance.
The default source issues a BGREWRITEAOF over the
configured Redis TCP endpoint, waits for the command to be
acknowledged, then reads the on-disk AOF file from disk and
pipes it over the entropy channel. Embedders
that need a different snapshot strategy plug in their own
SnapshotSource through the embedding API.
§Examples
use dynomite::entropy::RedisLocalSnapshot;
let source = RedisLocalSnapshot::default();
drop(source);Fields§
§redis_addr: SocketAddrAddress of the local Redis instance.
aof_path: PathBufPath to the AOF file on disk.
timeout: DurationConnect/read timeout.
bgrewrite_retries: u32Number of BGREWRITEAOF retries before giving up. The
count and the retry pause are exposed as parameters.
bgrewrite_retry_pause: DurationPause between BGREWRITEAOF retries.
Implementations§
Source§impl RedisLocalSnapshot
impl RedisLocalSnapshot
Sourcepub fn with_redis_addr(self, addr: SocketAddr) -> Self
pub fn with_redis_addr(self, addr: SocketAddr) -> Self
Override the Redis address.
Sourcepub fn with_aof_path(self, path: PathBuf) -> Self
pub fn with_aof_path(self, path: PathBuf) -> Self
Override the AOF on-disk path.
Trait Implementations§
Source§impl Default for RedisLocalSnapshot
impl Default for RedisLocalSnapshot
Source§impl SnapshotSource for RedisLocalSnapshot
impl SnapshotSource for RedisLocalSnapshot
Source§fn snapshot(&self) -> EntropyResult<Vec<u8>>
fn snapshot(&self) -> EntropyResult<Vec<u8>>
Produce one snapshot of the local state as a contiguous
byte buffer. The sender treats the bytes as opaque; the
receiver replays them through its
SnapshotSink. Read moreAuto Trait Implementations§
impl Freeze for RedisLocalSnapshot
impl RefUnwindSafe for RedisLocalSnapshot
impl Send for RedisLocalSnapshot
impl Sync for RedisLocalSnapshot
impl Unpin for RedisLocalSnapshot
impl UnsafeUnpin for RedisLocalSnapshot
impl UnwindSafe for RedisLocalSnapshot
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