Skip to main content

Python client for the Serf orchestration tool

Project description

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.

PyPI latest version badge Code coverage badge

Installation

asyncserf requires a running Serf agent. See Serf’s agent documentation for instructions.

To install asyncserf, run the following command:

$ pip install asyncserf

or alternatively (you really should be using pip though):

$ easy_install asyncserf

or from source:

$ 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.

from asyncserf import serf_client

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

Stream usage:

from asyncserf import serf_client

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

Development

You can run the tests using the following commands:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asyncserf-0.14.0.tar.gz (41.8 kB view details)

Uploaded Source

File details

Details for the file asyncserf-0.14.0.tar.gz.

File metadata

  • Download URL: asyncserf-0.14.0.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for asyncserf-0.14.0.tar.gz
Algorithm Hash digest
SHA256 369219c9b38a751355e3540b30fa87af1e3a1c054fa670655d17b7dc8abf0ce4
MD5 716926a03572af25c455bc1e7dc5e788
BLAKE2b-256 8e3b70a30f5a19719a4609172fc333a94b221ee30c24422adcf66eb434c3f21c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page