Skip to main content

ClassicProtocol

Struct ClassicProtocol 

Source
pub struct ClassicProtocol { /* private fields */ }
Expand description

The classic protocol: JoinGroup, SyncGroup, Heartbeat.

Implementations§

Source§

impl ClassicProtocol

Source

pub fn new( group_id: impl Into<String>, topics: Vec<String>, assignor: Box<dyn Assignor>, ) -> Self

Source

pub fn member(&self) -> &GroupMember

Source

pub fn set_session_timeout(&mut self, ms: i32)

How long the coordinator waits for a heartbeat before removing us.

Source

pub fn set_rebalance_timeout(&mut self, ms: i32)

How long the coordinator waits for every member to rejoin. Should exceed the longest a caller can spend between polls, or a slow consumer is dropped mid-rebalance.

Trait Implementations§

Source§

impl<T: Transport> GroupProtocol<T> for ClassicProtocol

Source§

async fn advance(&mut self, cluster: &mut Cluster<T>) -> Result<Membership>

Drive one step of membership. Called until it reports Membership stable.
Source§

async fn commit( &mut self, cluster: &mut Cluster<T>, offsets: &BTreeMap<TopicPartition, i64>, ) -> Result<()>

Commit these offsets for the group. Read more
Source§

fn topics(&self) -> Vec<String>

What this member is subscribed to, so the caller can watch those topics for changes the group must agree on.
Source§

fn request_rejoin(&mut self)

Ask to rejoin the group at the next Self::advance. Read more
Source§

fn group_metadata(&self) -> Option<GroupMetadata>

What proves this member is current, for a transactional producer. Read more
Source§

async fn committed( &mut self, cluster: &mut Cluster<T>, partitions: &[TopicPartition], ) -> Result<BTreeMap<TopicPartition, i64>>

Where this group last committed, for the partitions given. Read more
Source§

async fn leave(&mut self, cluster: &mut Cluster<T>) -> Result<()>

Leave deliberately, so the group rebalances now rather than at the session timeout.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.