【文件属性】:
文件名称:nats.py:适用于NATS.io的Python3客户端
文件大小:90KB
文件格式:ZIP
更新时间:2021-05-14 12:42:07
aio nats python3 asyncio cloud-native
NATS-适用于Asyncio的Python3客户端
用于的 Python客户端。
支持平台
至少应与兼容。
正在安装
pip install asyncio-nats-client
从版本开始,您还可以选择安装以便使用新的NATS v2.0身份验证功能:
pip install asyncio-nats-client[nkeys]
基本用法
import asyncio
from nats . aio . client import Client as NATS
from nats . aio . errors import ErrConnectionClosed , ErrTimeout , ErrNoServers
async def run ( loop ):
nc = NATS ()
await nc . connect ( "demo.nats.io:42
【文件预览】:
nats.py-master
----GOVERNANCE.md(222B)
----dependencies.md(224B)
----.gitignore(153B)
----setup.cfg(274B)
----Pipfile.lock(7KB)
----tests()
--------client_test.py(67KB)
--------nkeys()
--------certs()
--------client_nkeys_test.py(4KB)
--------parser_test.py(7KB)
--------utils.py(12KB)
--------nuid_test.py(2KB)
--------client_async_await_test.py(7KB)
--------__init__.py(0B)
----examples()
--------coroutine_threadsafe.py(3KB)
--------tls.py(2KB)
--------example.py(2KB)
--------context-manager.py(1KB)
--------nats-pub()
--------service.py(1KB)
--------advanced.py(2KB)
--------aiohttp-example.py(7KB)
--------nats-req()
--------subscribe.py(2KB)
--------wildcard.py(1KB)
--------client.py(3KB)
--------clustered.py(3KB)
--------drain-sub.py(3KB)
--------nats-sub()
--------basic.py(2KB)
----LICENSE(11KB)
----MAINTAINERS.md(336B)
----todo.md(636B)
----Pipfile(191B)
----script()
--------test.sh(59B)
--------install_nats.sh(607B)
----readme.md(10KB)
----benchmark()
--------latency_perf.py(2KB)
--------pub_sub_perf.py(3KB)
--------pub_perf.py(3KB)
--------parser_perf.py(2KB)
--------latency_async_perf.py(2KB)
--------inbox_perf.py(657B)
--------sub_perf.py(3KB)
--------sub_async_await_perf.py(3KB)
----nats()
--------aio()
--------__init__.py(730B)
--------protocol()
----CODE-OF-CONDUCT.md(138B)
----setup.py(899B)
----.travis.yml(508B)
----Makefile(633B)