pub struct ReplicationMaster { /* private fields */ }Expand description
Replication Master
WAL append 시 브로드캐스트 채널로 메시지를 전송합니다.
인메모리 tokio::sync::broadcast 채널 기반 MVP 구현.
Implementations§
Source§impl ReplicationMaster
impl ReplicationMaster
Sourcepub fn new(capacity: usize) -> (Self, Receiver<ReplicationMessage>)
pub fn new(capacity: usize) -> (Self, Receiver<ReplicationMessage>)
새 Master 생성. capacity는 채널 버퍼 크기.
Sourcepub fn replicate(&self, data: Vec<u8>) -> u64
pub fn replicate(&self, data: Vec<u8>) -> u64
WAL 데이터를 복제로 전송. LSN을 자동 증가.
data — 직렬화된 WAL 레코드 바이트
Sourcepub fn subscribe(&self) -> Receiver<ReplicationMessage>
pub fn subscribe(&self) -> Receiver<ReplicationMessage>
새 Slave를 위한 구독자 추가
Sourcepub fn current_lsn(&self) -> u64
pub fn current_lsn(&self) -> u64
현재 LSN
Auto Trait Implementations§
impl Freeze for ReplicationMaster
impl RefUnwindSafe for ReplicationMaster
impl Send for ReplicationMaster
impl Sync for ReplicationMaster
impl Unpin for ReplicationMaster
impl UnsafeUnpin for ReplicationMaster
impl UnwindSafe for ReplicationMaster
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