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
Raw data
{
"_id": null,
"home_page": "https://github.com/smurfix/asyncserf",
"name": "asyncserf",
"maintainer": "Matthias Urlichs",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "matthias@urlichs.de",
"keywords": "Serf,orchestration,service discovery,anyio",
"author": "Matthias Urlichs",
"author_email": "matthias@urlichs.de",
"download_url": "https://files.pythonhosted.org/packages/b1/cb/00b39bbe11de3af13e110475a64b72149fdabc6b057ffa0edb69133d8127/asyncserf-0.21.1.tar.gz",
"platform": null,
"description": "asyncserf\n=========\n\nasyncserf is an async Python interface to Serf, the decentralised solution\nfor service discovery and orchestration.\n\nIt uses `anyio <https://github.com/agronholm/anyio>` as its underlying\nasync framework.\n\n.. image:: https://badge.fury.io/py/asyncserf.svg\n :alt: PyPI latest version badge\n :target: https://pypi.python.org/pypi/asyncserf\n.. image:: https://coveralls.io/repos/smurfix/asyncserf/badge.png?branch=master\n :alt: Code coverage badge\n :target: https://coveralls.io/r/smurfix/asyncserf?branch=master\n\nInstallation\n------------\n\nasyncserf requires a running Serf agent. See `Serf's agent documentation\n<http://www.serfdom.io/docs/agent/basics.html>`_ for instructions.\n\nTo install asyncserf, run the following command:\n\n.. code-block:: bash\n\n $ pip install asyncserf\n\nor alternatively (you really should be using pip though):\n\n.. code-block:: bash\n\n $ easy_install asyncserf\n\nor from source:\n\n.. code-block:: bash\n\n $ python setup.py install\n\nGetting Started\n---------------\n\nThese examples require a running async loop.\n`Trio <https://github.com/python-trio/trio>` is recommended, though\n``asyncio`` works too.\n\nSending a message is easy::\n\n from asyncserf import serf_client\n\n async with serf_client() as client:\n await client.event('foo', b'bar')\n\nSo is receiving::\n\n.. code-block:: python\n\n from asyncserf import serf_client\n\n async with serf_client() as client:\n async with client.stream('foo') as stream:\n async for resp in stream:\n print(resp.payload)\n\nDevelopment\n------------\n\nYou can run the tests using the following commands:\n\n.. code-block:: bash\n\n $ serf agent --tag foo=bar & # start serf agent\n $ python3 -mpytest tests\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python client for the Serf orchestration tool",
"version": "0.21.1",
"split_keywords": [
"serf",
"orchestration",
"service discovery",
"anyio"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "bc56e03e42ff3f266dd260be54e4462c",
"sha256": "6b18de8e1e04f472d6a159aa7e05a1a72ba8434d192290a4fc5da532437575c1"
},
"downloads": -1,
"filename": "asyncserf-0.21.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bc56e03e42ff3f266dd260be54e4462c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 16111,
"upload_time": "2022-12-19T17:40:13",
"upload_time_iso_8601": "2022-12-19T17:40:13.584430Z",
"url": "https://files.pythonhosted.org/packages/66/a5/afdf5d3be8ccabea2a257e7a77f69aa441d6226ac4091de2b3339ea521ed/asyncserf-0.21.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "f36ec505bca3e499974db9186b80618c",
"sha256": "2f9144ded79ca73f63cfe20a5df370f903ef9c2472e8c267711ae4fb25479b38"
},
"downloads": -1,
"filename": "asyncserf-0.21.1.tar.gz",
"has_sig": false,
"md5_digest": "f36ec505bca3e499974db9186b80618c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 32491,
"upload_time": "2022-12-19T17:40:14",
"upload_time_iso_8601": "2022-12-19T17:40:14.817201Z",
"url": "https://files.pythonhosted.org/packages/b1/cb/00b39bbe11de3af13e110475a64b72149fdabc6b057ffa0edb69133d8127/asyncserf-0.21.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-19 17:40:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "smurfix",
"github_project": "asyncserf",
"travis_ci": true,
"coveralls": true,
"github_actions": false,
"tox": true,
"lcname": "asyncserf"
}