Executes the given action when a retry event occurs. This function can be used to listen to all retry events.