-
Notifications
You must be signed in to change notification settings - Fork 106
[8/n] Future gains result()/exception() and can be await more than once #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await). This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture. For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work. This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container. Differential Revision: [D76828364](https://our.internmc.facebook.com/intern/diff/D76828364/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)! [ghstack-poisoned]
Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await). This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture. For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work. This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container. Differential Revision: [D76828364](https://our.internmc.facebook.com/intern/diff/D76828364/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)! ghstack-source-id: 291007227 Pull Request resolved: #289
|
This pull request was exported from Phabricator. Differential Revision: D76828364 |
…ore than once" Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await). This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture. For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work. This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container. Differential Revision: [D76828364](https://our.internmc.facebook.com/intern/diff/D76828364/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)! [ghstack-poisoned]
Pull Request resolved: #289 Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await). This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture. For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work. This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container. ghstack-source-id: 291015937 @exported-using-ghexport Differential Revision: [D76828364](https://our.internmc.facebook.com/intern/diff/D76828364/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)!
|
This pull request was exported from Phabricator. Differential Revision: D76828364 |
…ore than once" Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await). This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture. For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work. This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container. Differential Revision: [D76828364](https://our.internmc.facebook.com/intern/diff/D76828364/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)! [ghstack-poisoned]
Pull Request resolved: #289 Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await). This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture. For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work. This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container. ghstack-source-id: 291041599 @exported-using-ghexport Differential Revision: [D76828364](https://our.internmc.facebook.com/intern/diff/D76828364/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)!
|
This pull request was exported from Phabricator. Differential Revision: D76828364 |
…ore than once" Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await). This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture. For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work. This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container. Differential Revision: [D76828364](https://our.internmc.facebook.com/intern/diff/D76828364/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)! [ghstack-poisoned]
|
This pull request was exported from Phabricator. Differential Revision: D76828364 |
…ore than once" Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await). This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture. For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work. This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container. Differential Revision: [D76828364](https://our.internmc.facebook.com/intern/diff/D76828364/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)! [ghstack-poisoned]
|
This pull request was exported from Phabricator. Differential Revision: D76828364 |
|
This pull request has been merged in 2dd3a9d. |
Stack from ghstack (oldest at bottom):
Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await).
This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture.
For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure all blocking_impl paths take a timeout parameter, which is way more work.
This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container.
Differential Revision: D76828364
NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!