Interface BatchAwareBackPressureHandler

All Superinterfaces:
BackPressureHandler
All Known Implementing Classes:
SemaphoreBackPressureHandler

public interface BatchAwareBackPressureHandler extends BackPressureHandler
BackPressureHandler specialization that allows requesting and releasing batches. Batch size should be configured by the implementations.
Since:
3.0
Author:
Tomaz Fernandes
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Return the configured batch size for this handler.
    void
    Release a batch of permits.
    int
    Request a batch of permits.

    Methods inherited from interface io.awspring.cloud.sqs.listener.BackPressureHandler

    drain, release, request
  • Method Details

    • requestBatch

      int requestBatch() throws InterruptedException
      Request a batch of permits.
      Returns:
      the number of permits acquired.
      Throws:
      InterruptedException - if the Thread is interrupted while waiting for permits.
    • releaseBatch

      void releaseBatch()
      Release a batch of permits. This has the semantics of letting the BackPressureHandler know that all permits from a batch are being released, in opposition to BackPressureHandler.release(int) in which any number of permits can be specified.
    • getBatchSize

      int getBatchSize()
      Return the configured batch size for this handler.
      Returns:
      the batch size.