Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
StreamingWorkunitHandler
to be a class-based context manag…
…er (#11685) Before, it was possible to call `StreamingWorkunitHandler.session()` multiple times, meaning we'd be starting and stopping the same threads during the same Pants run. While this wasn't done in practice beyond a test, it complicates future changes and is an inaccurate representation of what we expect. Even though it is still possible to do this with a class-based context manager, the class better expresses the intention than a reusable method. Further, this change will result in a RuntimeException if the user does use the context manager twice. [ci skip-rust] [ci skip-build-wheels]
- Loading branch information
1 parent
1902297
commit 0f27e41
Showing
3 changed files
with
82 additions
and
98 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.