Skip to main content

Helper library for interacting with flexes

Project description


Build Status codecov

Client library for flexes


For asynchronous task execution Python >= 3.5 is required.

Usage at a glance

To run a task through the API synchronously

from flexes_lib.job import run_task

message = {'service': 'echo-test', 'test': True}
result = run_task(message)
# active

Asynchronous tasks are also supported

from asyncio import get_event_loop
from flexes_lib.async_job import run_task

message = {'service': 'echo-test', 'test': True}
result = loop.run_until_complete(run_task(message))
# active

The nice thing about asynchronous tasks is that you can run them in parallel. This example submits three jobs in parallel and then waits for all three to complete before returning the results.

from asyncio import gather, get_event_loop
from flexes_lib.async_job import run_task

m1 = {'service': 'echo-test', 'test': True}
m2 = {'service': 'echo-test', 'test': True}
m3 = {'service': 'echo-test', 'test': True}
results = loop.run_until_complete(
print([result['status'] for result in results])
# ['active', 'active', 'active']

Project details

Download files

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

Files for flexes-lib, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size flexes_lib-0.1.1.tar.gz (7.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page