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.

Source Distribution

python-workq-0.1.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

python_workq-0.1-py2.py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 2 Python 3

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