dispatcher: support graceful stop