An assortment of utilities for the Trio async/await framework, including:
await_all- avoid nursery blocks for simple cases
AsyncValue- value wrappers with the ability to wait for a specific value or transition
AsyncDictionary- dictionary with waitable get and pop
periodic- a periodic loop which accounts for its own execution time
azip_longest- async zip with parallel iteration
MailboxRepeatedEvent- if you really, really want to reuse an event
- and more (... obscure stuff you probably don't need)!
See the online documentation for details.
pip install trio-util
What attributes make a good utility function or class?
- of general use, intuitive, hard to use incorrectly
- makes code more readable and reduces cognitive load
- already vetted for a length of time within a project, ideally used by multiple developers
If you have something that would be a good fit for trio-util, please open an issue on GitHub. We'll want to review the design, naming, and documentation.
This software is not supported by GROOVE X, Inc., and GROOVE X specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.