Skip to main content

Python Client for Workq

Project description

Python Client for Workq with asyncio .

Requirements

  • Python3.5+

Usage

Enqueue Foreground Job

import asyncio
import uuid
from workq.workq import WorkqClient
from workq.job import ForegroundJob


def main():
    loop = asyncio.new_event_loop()
    client = WorkqClient('127.0.0.1', 9922, loop)
    jobid = uuid.uuid4()
    job = ForegroundJob(jobid, "ping1", 5000, 60000, "hello fg job")
    try:
        loop.run_until_complete(client.connect())
        results = loop.run_until_complete(client.run(job))
    finally:
        loop.close()
    for result in results:
        print("job: %s %s %s" % (result.id, result.name, result.payload))

if __name__ == '__main__':
    main()

TODO

  • [ ] inspect command

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
python_workq-0.1-py2.py3-none-any.whl (5.7 kB) Copy SHA256 hash SHA256 Wheel 3.5 Oct 27, 2016
python-workq-0.1.tar.gz (4.3 kB) Copy SHA256 hash SHA256 Source None Oct 27, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page