ROM Gateways and sequel pools

Hi :slight_smile:

I’ve been using ROM in a multi-threaded app following the recommendation I found in one of the issues, this one: https://github.com/rom-rb/rom-sql/issues/309#issuecomment-384890852

Meaning, at the very beginning of my app (in the main thread), I do:
rom_base = new_config
rom_base.auto_registration

Then, at the workers, I call
rom_config = new_config
rom_config.register_relation(*rom_base.relation_classes)
container = ROM.container(rom_config)

However, I’m trying to understand how will that work regarding the underlying sequel connection pool. If I understand this well, it will create one gateway per container (And thus, one sequel connection pool per gateway?)

I understand this well, it will create one gateway per container (And thus, one sequel connection pool per gateway?)

Your understanding is correct :slightly_smiling_face:

And is there a way to reuse the pool? Or should I be dimensioning the pool differently for ROM, taking into consideration that I will have one connection per thread anyway?