recordProcessorAdapter - adapts a single record processor effect to a batch processor effect
you can control the concurrency of the batch processing by setting the concurrency outside
of this function, with the default being unbounded.
Example
import { Console, Effect, Either } from'effect'; import { SQSRecord, SQSEventHandler, recordProcessorAdapter } from'@effect-lambda'; // Define an effect that processes a single SQS record constprocessRecord = SQSRecord.pipe( Effect.tap((record) =>Console.log(record.body)) );
// Adapt the single record processor effect to handle a batch of records and use it with an SQSEventHandler exportconsthandler = processRecord.pipe( recordProcessorAdapter, Effect.withConcurrency(1), // optional if want sequential processing SQSEventHandler, );
recordProcessorAdapter - adapts a single record processor effect to a batch processor effect
you can control the concurrency of the batch processing by setting the concurrency outside of this function, with the default being
unbounded
.Example