-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(api): fix typing of task_queue workers (#14755)
task_queue has these cleanup and run functions that you pass in with some arguments to bind. None of this was typesafe because it predated ParamSpec. Now that we have ParamSpec, we can make these typesafe. ## changelog typing only in `task_queue`. `set_run_func` and `set_cleanup_func` get paramspecs. `set_run_func` is trivial; `set_cleanup_func` has a requirement to have an `error` argument (which has to be the first argument, for "paramspec still isn't good enough" reasons, but that was already an implicit requirement). also, we do a manual closure instead of `partial()` because I'm pretty sure `partial()` isn't actually typesafe.
- Loading branch information
Showing
1 changed file
with
24 additions
and
30 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