Trait streambed::commit_log::CommitLog

source ·
pub trait CommitLog:
    Clone
    + Send
    + Sync {
    // Required methods
    fn offsets<'life0, 'async_trait>(
        &'life0 self,
        topic: Topic,
        partition: Partition,
    ) -> Pin<Box<dyn Future<Output = Option<PartitionOffsets>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn produce<'life0, 'async_trait>(
        &'life0 self,
        record: ProducerRecord,
    ) -> Pin<Box<dyn Future<Output = Result<ProducedOffset, ProducerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn scoped_subscribe<'a>(
        &'a self,
        consumer_group_name: &str,
        offsets: Vec<ConsumerOffset>,
        subscriptions: Vec<Subscription>,
        idle_timeout: Option<Duration>,
    ) -> Pin<Box<dyn Stream<Item = ConsumerRecord> + Send + 'a>>;
}
Expand description

A commit log holds topics and can be appended to and tailed. Connections are managed and retried if they cannot be established.

Required Methods§

source

fn offsets<'life0, 'async_trait>( &'life0 self, topic: Topic, partition: Partition, ) -> Pin<Box<dyn Future<Output = Option<PartitionOffsets>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve the current offsets of a topic if they are present.

source

fn produce<'life0, 'async_trait>( &'life0 self, record: ProducerRecord, ) -> Pin<Box<dyn Future<Output = Result<ProducedOffset, ProducerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Publish a record and return the offset that was assigned.

source

fn scoped_subscribe<'a>( &'a self, consumer_group_name: &str, offsets: Vec<ConsumerOffset>, subscriptions: Vec<Subscription>, idle_timeout: Option<Duration>, ) -> Pin<Box<dyn Stream<Item = ConsumerRecord> + Send + 'a>>

Subscribe to one or more topics for a given consumer group having committed zero or more topics. The records are streamed back indefinitely unless an idle timeout argument is provided. In the case of an idle timeout, if no record is received within that period, None is returned to end the stream.

Object Safety§

This trait is not object safe.

Implementors§