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 3 5

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page