README.md in tobox-0.5.1 vs README.md in tobox-0.5.2

- old
+ new

@@ -217,18 +217,47 @@ exponential_retry_factor 2 ``` **Note**: the new attempt will be retried in `n ** 4`, where `n` is the number of past attempts for that event. +### `batch_size` + +Number of events fetched in each outbox loop. + +```ruby +batch_size 10 +``` + +**Note**: event handlers will receive all events covered by the given callback in its arguments: + +```ruby +on(:event1, :event2) do |*events| # at most 10 events, may contain events of type 1 and 2 +``` + ### `concurrency` Number of workers processing events. ```ruby concurrency 4 ``` **Note**: the default concurrency is adapted and different for each worker pool type, so make sure you understand how this tweak may affect you. + +### `max_connections` + +Number of database connections the workers will share to do their work. + +In the (default) threaded worker mode, it'll default to the number of workers (set by the `concurrency` configuration). + +```ruby +# 10 workers sharing 4 database connections +max_connections 4 +concurrency 10 +``` + +This can be useful when the database presents overhead in managing write intensive workload (such as the one an outbox generates), and you want to be able to scale without putting more work on the database. + ### `worker` Type of the worker used to process events. Can be `:thread` (default), `:fiber`, or a class implementing the `Tobox::Pool` protocol (TBD: define what this protocol is).