Class DataProducer<T>
Represents a data producer for publishing data to an Amazon Kinesis stream.
Implements
Inherited Members
Namespace: Innovt.Cloud.AWS.Kinesis
Assembly: Innovt.Cloud.AWS.Kinesis.dll
Syntax
public class DataProducer<T> : AwsBaseService, IDisposable where T : class, IDataStream
Type Parameters
Name | Description |
---|---|
T | The type of data streams to be published. |
Constructors
| Edit this page View SourceDataProducer(string, ILogger, IAwsConfiguration)
Initializes a new instance of the DataProducer<T> class with the specified bus name, logger, and AWS configuration.
Declaration
protected DataProducer(string busName, ILogger logger, IAwsConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
string | busName | The name of the Kinesis data stream (bus) to which data will be published. |
ILogger | logger | The logger for logging informational and error messages. |
IAwsConfiguration | configuration | The AWS configuration used to create AWS service clients. |
DataProducer(string, ILogger, IAwsConfiguration, string)
Initializes a new instance of the DataProducer<T> class with the specified bus name, logger, AWS configuration, and AWS region.
Declaration
protected DataProducer(string busName, ILogger logger, IAwsConfiguration configuration, string region)
Parameters
Type | Name | Description |
---|---|---|
string | busName | The name of the Kinesis data stream (bus) to which data will be published. |
ILogger | logger | The logger for logging informational and error messages. |
IAwsConfiguration | configuration | The AWS configuration used to create AWS service clients. |
string | region | The AWS region in which the Kinesis data stream is located. |
Fields
| Edit this page View SourceActivityDataProducer
Declaration
protected static readonly ActivitySource ActivityDataProducer
Field Value
Type | Description |
---|---|
ActivitySource |
Methods
| Edit this page View SourceDisposeServices()
Disposes the Amazon Kinesis client when the service is no longer needed.
Declaration
protected override void DisposeServices()
Overrides
| Edit this page View SourcePublish(IEnumerable<T>, CancellationToken)
Publishes a collection of data streams to the Kinesis data stream asynchronously.
Declaration
public Task Publish(IEnumerable<T> events, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | events | The collection of data streams to be published. |
CancellationToken | cancellationToken | Cancellation token to cancel the operation. |
Returns
Type | Description |
---|---|
Task | Task representing the asynchronous publish operation. |
Publish(T, CancellationToken)
Publishes a single data stream to the Kinesis data stream asynchronously.
Declaration
public Task Publish(T data, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
T | data | The data stream to be published. |
CancellationToken | cancellationToken | Cancellation token to cancel the operation. |
Returns
Type | Description |
---|---|
Task | Task representing the asynchronous publish operation. |