class RubyEventStore::Outbox::Consumer::Configuration

Attributes

batch_size[R]
cleanup[R]
database_url[R]
message_format[R]
redis_url[R]
sleep_on_empty[R]
split_keys[R]

Public Class Methods

new( split_keys:, message_format:, batch_size:, database_url:, redis_url:, cleanup:, sleep_on_empty: ) click to toggle source
# File lib/ruby_event_store/outbox/consumer.rb, line 17
def initialize(
  split_keys:,
  message_format:,
  batch_size:,
  database_url:,
  redis_url:,
  cleanup:,
  sleep_on_empty:
)
  @split_keys = split_keys
  @message_format = message_format
  @batch_size = batch_size || 100
  @database_url = database_url
  @redis_url = redis_url
  @cleanup = cleanup
  @sleep_on_empty = sleep_on_empty
  freeze
end

Public Instance Methods

with(overriden_options) click to toggle source
# File lib/ruby_event_store/outbox/consumer.rb, line 36
def with(overriden_options)
  self.class.new(
    split_keys: overriden_options.fetch(:split_keys, split_keys),
    message_format: overriden_options.fetch(:message_format, message_format),
    batch_size: overriden_options.fetch(:batch_size, batch_size),
    database_url: overriden_options.fetch(:database_url, database_url),
    redis_url: overriden_options.fetch(:redis_url, redis_url),
    cleanup: overriden_options.fetch(:cleanup, cleanup),
    sleep_on_empty: overriden_options.fetch(:sleep_on_empty, sleep_on_empty)
  )
end