Consumer

nl.vroste.zio.kinesis.interop.futures.Consumer
See theConsumer companion object
class Consumer

A scala-native Future based interface to the zio-kinesis Consumer

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def close(): Unit
def consumeWith[T](streamName: String, applicationName: String, deserializer: Deserializer[Any, T], workerIdentifier: String, fetchMode: FetchMode, leaseCoordinationSettings: LeaseCoordinationSettings, initialPosition: InitialPosition, emitDiagnostic: DiagnosticEvent => Unit, shardAssignmentStrategy: ShardAssignmentStrategy, checkpointBatchSize: Long, checkpointDuration: Duration)(recordProcessor: Record[T] => ExecutionContext => Future[Unit]): CancelableFuture[Unit]

Apply an effectful function to each record in a stream

Apply an effectful function to each record in a stream

This is the easiest way to consume Kinesis records from a stream, while benefiting from all of Consumer's features like parallel streaming, checkpointing and resharding.

Simply provide an asynchronous function that is applied to each record and the rest is taken care of. The function will be called for every record in the stream, with a parallelism.

Attributes

T

Type of record values

checkpointBatchSize

Maximum number of records before checkpointing

checkpointDuration

Maximum interval before checkpointing

recordProcessor

A function for processing a Record[T]

Returns:

A cancelable future that completes with Unit when record processing is stopped or fails when the consumer stream fails

Implicits

Implicits

implicit val unsafe: Unsafe