Struct dynamo_subscriber::stream::DynamodbStreamBuilder
source · pub struct DynamodbStreamBuilder<Client>where
Client: DynamodbClient + 'static,{ /* private fields */ }Expand description
A builder for DynamodbStream.
Implementations§
source§impl<Client> DynamodbStreamBuilder<Client>where
Client: DynamodbClient + 'static,
impl<Client> DynamodbStreamBuilder<Client>where Client: DynamodbClient + 'static,
sourcepub fn table_name(self, table_name: impl Into<String>) -> Self
pub fn table_name(self, table_name: impl Into<String>) -> Self
Set table name you want to retrieve records from.
Setting any table name is required before the build method is called.
sourcepub fn client(self, client: Client) -> Self
pub fn client(self, client: Client) -> Self
Set client to call AWS APIs.
Setting any client is required before the build method is called.
sourcepub fn shard_iterator_type(self, shard_iterator_type: ShardIteratorType) -> Self
pub fn shard_iterator_type(self, shard_iterator_type: ShardIteratorType) -> Self
Set ShardIteratorType to get records for the first time.
After the first time, the DynamodbStream uses the shard iterator from the previous
get records operation outputs.
Setting any shard iterator type is optional. If you omit calling this method,
ShardIteratorType::Latest is used as default value.
sourcepub fn interval(self, interval: Option<Duration>) -> Self
pub fn interval(self, interval: Option<Duration>) -> Self
Set interval between polling attempts. When None is provided there are no intervals between polling iterations.
Setting any interval is optional. If you omit calling this method,
3 seconds is used as default value.
sourcepub fn buffer(self, buffer: usize) -> Self
pub fn buffer(self, buffer: usize) -> Self
Set the buffer for tokio::sync::mpsc::channel.
The stream records are stored up to the buffer size unless the records are consumed. Once the buffer is full, attempts to receive records from the DynamoDB Streams will wait until the records is consumed.
This method will panic when given zero as buffer size.
Setting buffer size is optional. If you omit calling this method,
100 is used as default value.
sourcepub fn build(self) -> DynamodbStream
pub fn build(self) -> DynamodbStream
Consumes the builder and constructs a DynamodbStream.
This method will panic if no table name is set or no client is set.