Accepts payloads for writing to Kinesis in the background, up to a limit

Hierarchy

  • KinesisBackgroundWriter

Constructors

Properties

Accessors

Methods

Constructors

  • Creates a new KinesisBackgroundWriter

    Allows up to concurrency payloads to be in progress before write will block until a payload completes.

    Parameters

    • options: {
          concurrency?: number;
          kinesisClient: KinesisPutRecordsSend;
      }

      KinesisBackgroundWriter options

      • Optional concurrency?: number

        Number of payloads to accept for background writing before requiring the caller to wait for one to complete.

        Default Value

        4

      • kinesisClient: KinesisPutRecordsSend

        Required - Can be KinesisClient or KinesisRetrier

    Returns KinesisBackgroundWriter

Properties

_errors: Errors = []
_kinesisClient: KinesisPutRecordsSend
_writer: IterableQueueMapperSimple<PutRecordsCommand>

Accessors

Methods

  • Wait for all background writes to finish. MUST be called before exit to ensure no lost writes.

    Returns Promise<void>

  • Accept a request for sending in the background if a concurrency slot is available. Else, do not return until a concurrency slot is freed up.

    This provides concurrency background writes with back pressure to prevent the caller from getting too far ahead.

    Individual PutRecordsCommand records that fail after retries are added to the errors property.

    MUST await onIdle for background send's to finish

    SHOULD periodically check errors for any individual record failures from send's

    Parameters

    • command: PutRecordsCommand

    Returns Promise<void>

Generated using TypeDoc