The current implementation of connection pooling in Mojito.Pool is a naive Poolboy setup, with the limitation that the pool should only be used to connect to a single protocol+host+port. Otherwise, the connection checked out of the pool is likely to be a connection to a different server, and we drop the existing connection and open another.
Consider a two-level pooling system, where a pool exists for each protocol+host+port we want to make requests to, and the process registry directs each request to its correct pool.
(Thanks to @ericmj for talking this through on Slack)
The current implementation of connection pooling in
Mojito.Pool
is a naive Poolboy setup, with the limitation that the pool should only be used to connect to a single protocol+host+port. Otherwise, the connection checked out of the pool is likely to be a connection to a different server, and we drop the existing connection and open another.Consider a two-level pooling system, where a pool exists for each protocol+host+port we want to make requests to, and the process registry directs each request to its correct pool.
(Thanks to @ericmj for talking this through on Slack)