Closed tkaitchuck closed 4 years ago
handle_release is called when connections close, so with that along with handle_acquire, your event handler should be able to figure out when there are no active connections: https://docs.rs/r2d2/0.8.8/r2d2/event/trait.HandleEvent.html#method.handle_release
Would it be possible to get an even for the
HandleEvent
trait set via theevent_handler
to get notified if all the connections are closed? Or perhaps it could just notify on connection close, as it would be then easy to get theState
of the pool.This would be helpful as a way to clean up pools for endpoints that are no longer being used.