-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[serve] Refactor
UserCallableWrapper
to return `concurrent.futures.…
…Future` (#48449) Previously, `UserCallableWrapper` wrapped results in an `asyncio.Future`. This was convenient for use in the replica, but this code will be re-used from a sync context for local testing mode, so I need access to the underlying `concurrent.futures.Future` instead. Alternatively we could add a duplicate path that returns the concurrent future instead, but I actually prefer that this is more explicitly clear that the code is running on a separate thread (will help defend against mistaken bugs in the future). I've also moved the `_user_callable_thread` and event loop into instance attributes instead of class attributes. I must have missed something when implementing this previously because this was basically trivial. --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
- Loading branch information
Showing
2 changed files
with
177 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.