pub trait PostCommitHook: Send + Sync {
// Required method
fn on_commit(&self, info: &CommitInfo) -> Result<(), ClientError>;
}Expand description
Trait for post-commit hooks
Implement this trait to receive notifications after offsets are committed. Use cases include: external offset persistence, metrics, audit logging.
Required Methods§
Sourcefn on_commit(&self, info: &CommitInfo) -> Result<(), ClientError>
fn on_commit(&self, info: &CommitInfo) -> Result<(), ClientError>
Called after an offset is successfully committed
This method should not block for extended periods. For expensive operations, consider spawning a task or using a channel.