Added on_worker_shutdown hook mechanism