Created by: mosilla
Previously, calling close could result in Redis connections being closed before internal timers depending on those connections have executed or been cancelled. This would cause the application to hang indefinitely.
This commit renames the old close method to disconnect and adds a new close implementation which wraps disconnect but defers the call until all outstanding timer handles have been released.
This ensures that close is safe to call from anywhere at any time, even from within a job handler.