pub struct PostgresProjectorCoordinator { /* private fields */ }Expand description
Postgres-backed projector coordinator for distributed leadership.
PostgresProjectorCoordinator uses PostgreSQL advisory locks to ensure
only one projector instance processes events for a given subscription
at a time, preventing duplicate processing in distributed deployments.
Implementations§
Source§impl PostgresProjectorCoordinator
impl PostgresProjectorCoordinator
Sourcepub async fn new<S: Into<String>>(
connection_string: S,
) -> Result<Self, CoordinationError>
pub async fn new<S: Into<String>>( connection_string: S, ) -> Result<Self, CoordinationError>
Create a new PostgresProjectorCoordinator with default configuration.
Sourcepub async fn with_config<S: Into<String>>(
connection_string: S,
config: PostgresConfig,
) -> Result<Self, CoordinationError>
pub async fn with_config<S: Into<String>>( connection_string: S, config: PostgresConfig, ) -> Result<Self, CoordinationError>
Create a new PostgresProjectorCoordinator with custom configuration.
Trait Implementations§
Source§impl Clone for PostgresProjectorCoordinator
impl Clone for PostgresProjectorCoordinator
Source§fn clone(&self) -> PostgresProjectorCoordinator
fn clone(&self) -> PostgresProjectorCoordinator
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 moreSource§impl Debug for PostgresProjectorCoordinator
impl Debug for PostgresProjectorCoordinator
Source§impl ProjectorCoordinator for PostgresProjectorCoordinator
impl ProjectorCoordinator for PostgresProjectorCoordinator
Source§type Error = CoordinationError
type Error = CoordinationError
Error type returned when leadership acquisition fails. Read more
Source§type Guard = CoordinationGuard
type Guard = CoordinationGuard
Guard type that releases leadership when dropped. Read more
Auto Trait Implementations§
impl Freeze for PostgresProjectorCoordinator
impl !RefUnwindSafe for PostgresProjectorCoordinator
impl Send for PostgresProjectorCoordinator
impl Sync for PostgresProjectorCoordinator
impl Unpin for PostgresProjectorCoordinator
impl !UnwindSafe for PostgresProjectorCoordinator
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> 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 more