forechan:用于Python的Go样式CSP

时间:2021-02-28 08:28:40
【文件属性】:
文件名称:forechan:用于Python的Go样式CSP
文件大小:21KB
文件格式:ZIP
更新时间:2021-02-28 08:28:40
Python 前锋 风格asyncio渠道。 带有泛型的完整类型,可mypy 。 受的启发。 例子 发送和接收 ch = chan ( int ) # Chan[int] await ( ch << 2 ) # or use `await ch.send(x)` two = await ([] << ch ) # or use `await ch.recv()` assert two == 2 # `ch.close()` is idempotent await ch . close () 基本的 if ch : # if `Chan[T]` is open len ( ch ) # How many items are in `ch` async with ch : # close `ch` after exiting lexical-scope async
【文件预览】:
forechan-four
----setup.py(586B)
----.mypy.ini(489B)
----.gitignore(37B)
----__init__.py(0B)
----.github()
--------.agp(89B)
--------workflows()
----README.md(2KB)
----tests()
--------consts.py(115B)
--------__init__.py(0B)
--------cases()
----test.py(1KB)
----forechan()
--------mailbox.py(1KB)
--------wait_group.py(3KB)
--------chan.py(4KB)
--------__init__.py(364B)
--------types.py(3KB)
--------_da.py(462B)
--------context.py(3KB)
--------broadcast.py(529B)
--------selector.py(3KB)
--------pubsub.py(415B)
--------bufs.py(1KB)
--------py.typed(0B)
--------ops.py(1KB)
--------select.py(710B)
--------pipe.py(2KB)
----lint.sh(507B)

网友评论