跳转到主要内容

Serf编排工具的Python客户端

项目描述

AioSerf是Serf的异步Python接口,Serf是一种去中心化的服务发现和编排解决方案。

它使用anyio <https://github.com/agronholm/anyio>,因此应该与asynciotriocurio兼容。希望如此。

PyPI latest version badge Code coverage badge

安装

aioserf需要一个正在运行的Serf代理。有关说明,请参阅Serf代理文档

要安装aioserf,请运行以下命令

$ pip install aioserf

或者(尽管您应该使用pip)

$ easy_install aioserf

或者从源安装

$ python setup.py install

入门指南

以下示例需要运行的异步循环。Trio <https://github.com/python-trio/trio>推荐,但asyncio也可以。

from aioserf import serf_client

async with serf_client() as client:
    await client.event('foo', 'bar')

流使用

from aioserf import serf_client

async with serf_client() as client:
    async with client.stream('*') as stream:
        async for resp in stream:
            print(resp)

开发

aioserf需要一个正在运行的Serf代理。有关说明,请参阅Serf代理文档

您可以使用以下命令运行测试

$ serf agent --tag foo=bar & # start serf agent
$ python3 -mpytest tests

项目详情


下载文件

下载适合您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源代码分发

aioserf-0.3.3.post3.tar.gz (30.0 kB 查看哈希值)

上传时间: 源代码

支持者