Skip to main content

Python client for the Serf orchestration tool

Project description

AioSerf is an async Python interface to Serf, the decentralised solution for service discovery and orchestration.

It uses anyio <https://github.com/agronholm/anyio>, thus should work with asyncio, trio, and curio. Hopefully.

PyPI latest version badge Code coverage badge

Installation

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

To install aioserf, run the following command:

$ pip install aioserf

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

$ easy_install aioserf

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 aioserf import serf_client

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

Stream usage:

from aioserf import serf_client

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

Development

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

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

aioserf-0.3.1.tar.gz (28.9 kB view details)

Uploaded Source

File details

Details for the file aioserf-0.3.1.tar.gz.

File metadata

  • Download URL: aioserf-0.3.1.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for aioserf-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b8d87ad52787a4278c160a0df420a0610b97e05b45c3abee40c351a3aced07d1
MD5 f83c63890ced40489fd1817b82f2a314
BLAKE2b-256 f279d9af63aa386e3b898196b23adc3f41b92d262851cd9b7b682cc08537c3dd

See more details on using hashes here.

Provenance

Supported by

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