/sequel_fresh_connections

Remove stale connections from your Sequel connection pool

Primary LanguageRuby

Deprecated

As of Sequel 4.36.0 a connection_expiration extension has been added which replaces this gem.

github.com/jeremyevans/sequel/blob/master/lib/sequel/extensions/connection_expiration.rb


Fresh Connections

The fresh_connections extension removes stale connections from the connection pool, ensuring any connections that have timed out won’t be used.

Enable the extension with:

Sequel.extension :fresh_connections

A :max_connection_age option will then be available with Sequel::connect, this allows setting the maximum age a connection is allowed to reach before being removed from the pool.

Sequel.connect(..., :max_connection_age => 600)

Each time a connection is used its age is reset, so as long as connections are in constant use they will not be removed from the pool.

Sequel version compatibility

  sequel  | sequel_fresh_connections
----------+-------------------------
<= 3.40.0 |          0.1.0
>= 3.41.0 |          0.2.0