pub trait Config where
EffectOf<Self::Node>: AsLeaseEffect, {
type Node: Node;
type Applicable: ApplicableTo<StateOf<Self::Node>> + 'static;
type RetryPolicy: RetryPolicy<Invocation = InvocationOf<Self::Node>, Error = AppendError<InvocationOf<Self::Node>>, StaticError = AppendError<InvocationOf<Self::Node>>>;
type Leases<'a>: Iterator<Item = &'a <EffectOf<Self::Node> as AsLeaseEffect>::Lease>
where
Self: 'a;
fn active_leases(
&self,
state: &FrozenStateOf<Self::Node>
) -> Self::Leases<'_>;
fn release(
&self,
lease_id: <<EffectOf<Self::Node> as AsLeaseEffect>::Lease as Lease>::Id
) -> Self::Applicable;
fn retry_policy(&self) -> Self::RetryPolicy;
fn init(&mut self, node: &Self::Node) { ... }
fn update(&mut self, event: &EventFor<Self::Node>) { ... }
}
Expand description
Releaser configuration.
Required Associated Types
type Applicable: ApplicableTo<StateOf<Self::Node>> + 'static
type Applicable: ApplicableTo<StateOf<Self::Node>> + 'static
The applicable that is used to release leases.
type RetryPolicy: RetryPolicy<Invocation = InvocationOf<Self::Node>, Error = AppendError<InvocationOf<Self::Node>>, StaticError = AppendError<InvocationOf<Self::Node>>>
type RetryPolicy: RetryPolicy<Invocation = InvocationOf<Self::Node>, Error = AppendError<InvocationOf<Self::Node>>, StaticError = AppendError<InvocationOf<Self::Node>>>
Type of retry policy to be used.
See retry_policy
.
Required Methods
fn active_leases(&self, state: &FrozenStateOf<Self::Node>) -> Self::Leases<'_>
fn active_leases(&self, state: &FrozenStateOf<Self::Node>) -> Self::Leases<'_>
Returns the active leases for state
.
fn release(
&self,
lease_id: <<EffectOf<Self::Node> as AsLeaseEffect>::Lease as Lease>::Id
) -> Self::Applicable
fn release(
&self,
lease_id: <<EffectOf<Self::Node> as AsLeaseEffect>::Lease as Lease>::Id
) -> Self::Applicable
Prepares to release the lease with the given id.
fn retry_policy(&self) -> Self::RetryPolicy
fn retry_policy(&self) -> Self::RetryPolicy
Creates a retry policy.