The first version of tobox (v0.5.0) has been released.
tobox implements the consumer side of the transactional outbox pattern,
providing a simple way to configure your event handlers.
* OS / tobox · GitLab
* Pattern: Transactional outbox
tobox executes your handlers in a worker pool. The worker pool can be
thread-based (default) or fiber-based.
It uses the “SKIP LOCKED” SQL dialect to support concurrent polling for
events from the database outbox table. It therefore only supports databases
implementing it. As of today, that's:
* PostgreSQL 9.5+
* MySQL 8+
* Oracle
* Microsoft SQL Server
It ships with plugins for sentry, datadog and zeitwerk. The plugin system
is itself very simple, so you can add your own custom logic around event
processing.
It can be used as a background job processor, although it’s best used in
tandem with an existing framework.
Here are the updates since the last release:
## [0.5.0] - 2024-09-16
### Features
A new `:progress` plugin can be used in order to release database
transactions before handling events (useful for when event handling times
vary and may cause transaction bookkeeping overhead in the database).
**Note**: This may become the default behaviour in a future release.
### Improvements
* The event grouping and inbox capabilities were converted into plugins
(respectively, `:event_grouping` and `:inbox`).
### Bugfixes
* exponential backoff calculation was broken.
* behaviour fixed for databases which do not support `ON CONFLICT` or
`UPDATE ... RETURNING` (like MySQL).
## [0.4.5] - 2024-02-28
### Bugfixes
Fixed latest barrage of `ddtrace` discontinued config APIs, which is still
happening under minor releases.
## [0.4.4] - 2023-07-26
### Improvements
A new option, `database_options`, is now supported. The resulting hash is
passed to ´Sequel.connect` on database initialization.
## [0.4.3] - 2023-06-01
### Bugfixes
The `sentry` plugin didn't load correctly: given that app code loads before
the `tobox` config, it means that, if app code runs `Sentry.init`, then the
`tobox` config won't be able to fiddle anymore with it. This fixes it by
making the Sentry.init call a part of the `sentry` plugin.
This means that `tobox` config now includes a new callback:
plugin(:sentry)
on_sentry_init do |sentry_cfg|
sentry_cfg.dsn = ...
### Improvements
## [0.4.2] - 2023-05-25
### Improvements
`stats` plugin: use `max_connections = 1` instead of enabling single
threaded mode for the dedicated `sequel` database object.
The single threaded mode is not compliant with some `sequel` plugins and
extensions, most notable the `:connection_validator` plugin.
## [0.4.1] - 2023-05-24
### Features
#### `on_database_connect`
this adds an extension point for internal sequel database objects, in cases
where some tweaks are required (such as in the case of, when using database
SSL proxies, setting connection validators).
# tobox.rb
on_database_connect do |db|
db.extension(:connection_validator)
end