method

sequential_maintenance

sequential_maintenance(candidate_selector, &maintenance_work)
private

Perform maintenance work on pool connections. This method will select a connection to work on by calling the candidate_selector proc while holding the pool lock. If a connection is selected, it will be checked out for maintenance and passed to the maintenance_work proc. The connection will always be returned to the pool after the proc completes.

If the pool has async threads, all work will be scheduled there. Otherwise, this method will block until all work is complete.

Each connection will only be processed once per call to this method, but (particularly in the async case) there is no protection against a second call to this method starting to work through the list before the first call has completed. (Though regular pool behavior will prevent two instances from working on the same specific connection at the same time.)