def async_producer(delivery_interval: 0, delivery_threshold: 0, max_queue_size: 1000, max_retries: -1, retry_backoff: 0, **options)
      sync_producer = producer(**options)

      AsyncProducer.new(
        sync_producer: sync_producer,
        delivery_interval: delivery_interval,
        delivery_threshold: delivery_threshold,
        max_queue_size: max_queue_size,
        max_retries: max_retries,
        retry_backoff: retry_backoff,
        instrumenter: @instrumenter,
        logger: @logger,
      )
    end
def async_producer(delivery_interval: 0, delivery_threshold: 0, max_queue_size: 1000, max_retries: -1, retry_backoff: 0, **options)
      sync_producer = producer(**options)

      AsyncProducer.new(
        sync_producer: sync_producer,
        delivery_interval: delivery_interval,
        delivery_threshold: delivery_threshold,
        max_queue_size: max_queue_size,
        max_retries: max_retries,
        retry_backoff: retry_backoff,
        instrumenter: @instrumenter,
        logger: @logger,
      )
    end
Creates a new AsyncProducer instance.

 All parameters allowed by {#producer} can be passed. In addition to this,
 a few extra parameters can be passed when creating an async producer.

 @param max_queue_size [Integer] the maximum number of messages allowed in
   the queue.
 @param delivery_threshold [Integer] if greater than zero, the number of
   buffered messages that will automatically trigger a delivery.
 @param delivery_interval [Integer] if greater than zero, the number of
   seconds between automatic message deliveries.

 @see AsyncProducer
 @return [AsyncProducer]