Trait rdkafka::consumer::ConsumerContext
[−]
[src]
pub trait ConsumerContext: Context { fn rebalance(&self,
native_client: &NativeClient,
err: RDKafkaRespErr,
partitions_ptr: *mut RDKafkaTopicPartitionList) { ... } fn pre_rebalance(&self, _rebalance: &Rebalance) { ... } fn post_rebalance(&self, _rebalance: &Rebalance) { ... } }
Consumer specific Context. This user-defined object can be used to provide custom callbacks to consumer events. Refer to the list of methods to check which callbacks can be specified.
Provided Methods
fn rebalance(&self,
native_client: &NativeClient,
err: RDKafkaRespErr,
partitions_ptr: *mut RDKafkaTopicPartitionList)
native_client: &NativeClient,
err: RDKafkaRespErr,
partitions_ptr: *mut RDKafkaTopicPartitionList)
Implements the default rebalancing strategy and calls the pre_rebalance
and
post_rebalance
methods. If this method is overridden, it will be responsibility
of the user to call them if needed.
fn pre_rebalance(&self, _rebalance: &Rebalance)
Pre-rebalance callback. This method will run before the rebalance and should terminate its execution quickly.
fn post_rebalance(&self, _rebalance: &Rebalance)
Post-rebalance callback. This method will run after the rebalance and should terminate its execution quickly.
Implementors
impl ConsumerContext for EmptyConsumerContext