-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Worker to support concurrent predictions
This adds a max_concurrency parameter to Worker that allows it to accept predictions while others are already in-flight. I have removed the PROCESSING WorkerState; in concurrent mode, there is no distinction between READY and PROCESSING because we might be able to accept a prediction in either case. Worker now keeps track of multiple in-flight predictions in a dictionary, keyed on tag. Tags are required if max_concurrency > 1. Otherwise tags are optional (and, if omitted, we store the prediction with tag=None). There is one awkward place which is _prepare_payload(). As I understand it, this synchronously downloads URLFiles, which will block us from processing any other updates from the child while we download the URL.
- Loading branch information
1 parent
f8a5f8c
commit 9c51063
Showing
3 changed files
with
214 additions
and
91 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
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.