Centralize setting messageId in RequestCallback (#57848)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57848
This PR looks large, but all it does is add a dozen lines and remove a lot of other ones.
One first advantage of using Futures is that we can easily chain some "post-processing" to them. Until now we needed to pass the message ID around everywhere because it was set separately by each method. Instead, we could simply add a follow-up step to the final future which sets this ID, and remove all the former logic.
ghstack-source-id: 129567065
Test Plan: CI
Reviewed By: mrshenli
Differential Revision: D28224477
fbshipit-source-id: 7b6e21646262abe5bbbf268897e2d792e5accc27