asyncserf-0.9.2
توضیحات
Python client for the Serf orchestration tool
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | asyncserf-0.9.2 |
| نام | asyncserf |
| نسخه کتابخانه | 0.9.2 |
| نگهدارنده | ['Matthias Urlichs'] |
| ایمیل نگهدارنده | ['matthias@urlichs.de'] |
| نویسنده | Matthias Urlichs |
| ایمیل نویسنده | matthias@urlichs.de |
| آدرس صفحه اصلی | https://github.com/smurfix/asyncserf |
| آدرس اینترنتی | https://pypi.org/project/asyncserf/ |
| مجوز | MIT |
asyncserf
=========
asyncserf is an async Python interface to Serf, the decentralised solution
for service discovery and orchestration.
It uses `anyio <https://github.com/agronholm/anyio>` as its underlying
async framework.
.. image:: https://badge.fury.io/py/asyncserf.svg
:alt: PyPI latest version badge
:target: https://pypi.python.org/pypi/asyncserf
.. image:: https://coveralls.io/repos/smurfix/asyncserf/badge.png?branch=master
:alt: Code coverage badge
:target: https://coveralls.io/r/smurfix/asyncserf?branch=master
Installation
------------
asyncserf requires a running Serf agent. See `Serf's agent documentation
<http://www.serfdom.io/docs/agent/basics.html>`_ for instructions.
To install asyncserf, run the following command:
.. code-block:: bash
$ pip install asyncserf
or alternatively (you really should be using pip though):
.. code-block:: bash
$ easy_install asyncserf
or from source:
.. code-block:: bash
$ python setup.py install
Getting Started
---------------
These examples require a running async loop.
`Trio <https://github.com/python-trio/trio>` is recommended, though
``asyncio`` works too.
Sending a message is easy::
from asyncserf import serf_client
async with serf_client() as client:
await client.event('foo', b'bar')
So is receiving::
.. code-block:: python
from asyncserf import serf_client
async with serf_client() as client:
async with client.stream('foo') as stream:
async for resp in stream:
print(resp.payload)
Development
------------
You can run the tests using the following commands:
.. code-block:: bash
$ serf agent --tag foo=bar & # start serf agent
$ python3 -mpytest tests
نیازمندی
| مقدار | نام |
|---|---|
| >=3 | anyio |
| >=18.1 | attrs |
| >=0.5.0 | msgpack |
| - | outcome |
| - | async-exit-stack |
| - | async-generator |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl asyncserf-0.9.2:
pip install asyncserf-0.9.2.whl
نصب پکیج tar.gz asyncserf-0.9.2:
pip install asyncserf-0.9.2.tar.gz