driftphp / reactphp-dbal

DBAL for ReactPHP on top of Doctrine
https://driftphp.io
41 stars 6 forks source link

Added keep-alive strategy #26

Closed marinhekman closed 2 years ago

marinhekman commented 2 years ago

Added keep-alive strategy as suggested by @mmoreram in https://github.com/driftphp/reactphp-dbal/pull/24

marinhekman commented 2 years ago

@mmoreram Hi Marc, as you can see I implemented the keep alive strategy. Please review it.

marinhekman commented 2 years ago

@mmoreram there is a breaking change. I removed the $connections from Credentials class since the "number of connections" is now in a different class ConnectionPoolOptions which extends the ConnectionOptions class. Seems a more logical place? I also removed the array $options from Credentials since that did not seem to be used, and we have a class ConnectionOptions now? The ConnectionOptions class has a int $keepAliveIntervalSec .

Do you think we need to keep supporting the int $connections in the Credentials class for backwards compatibility? Of course, we can do that if you want.

marinhekman commented 2 years ago

Do you think we need to keep supporting the int $connections in the Credentials class for backwards compatibility? Of course, we can do that if you want.

@mmoreram I will look into making it backwards compatible with a deprecations notice.

marinhekman commented 2 years ago

@mmoreram ok, it should be backwards compatible now, but review it carefully