Skip to content
项目

关于

构建于 Trio 或 asyncio 之上的高级异步并发与网络框架。

系统与基础设施

这些数字如何统计

可以做什么

  • Task groups (nurseries in trio terminology)
  • Happy eyeballs algorithm for TCP connections (more robust than that of asyncio on Python 3.8)
  • async/await style UDP sockets (unlike asyncio where you still have to use Transports and Protocols)
  • A versatile API for byte streams and object streams

实测星标增长

24小时
0
7天
+3
15天
+8
1个月
+16

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文
Build Status Code Coverage Documentation Gitter chat Tidelift

AnyIO is an asynchronous networking and concurrency library that works on top of either asyncio or Trio. It implements Trio-like structured concurrency (SC) on top of asyncio and works in harmony with the native SC of Trio itself.

Applications and libraries written against AnyIO's API will run unmodified on either asyncio or Trio. AnyIO can also be adopted into a library or application incrementally – bit by bit, no full refactoring necessary. It will blend in with the native libraries of your chosen backend.

To find out why you might want to use AnyIO's APIs instead of asyncio's, you can read about it here.

Documentation

View full documentation at: https://anyio.readthedocs.io/

Features

AnyIO offers the following functionality:

  • Task groups (nurseries in trio terminology)
  • High-level networking (TCP, UDP and UNIX sockets)
    • Happy eyeballs algorithm for TCP connections (more robust than that of asyncio on Python 3.8)
    • async/await style UDP sockets (unlike asyncio where you still have to use Transports and Protocols)
  • A versatile API for byte streams and object streams
  • Inter-task synchronization and communication (locks, conditions, events, semaphores, object streams and futures)
  • Worker threads
  • Subprocesses
  • Subinterpreter support for code parallelization (on Python 3.13 and later)
  • Asynchronous file I/O (using worker threads)
  • Signal handling
  • Asynchronous versions of the functools and itertools modules

AnyIO also comes with its own pytest plugin which also supports asynchronous fixtures. It even works with the popular Hypothesis library.

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

探索相关项目

加载中…