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.

Files for python-workq, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size python_workq-0.1-py2.py3-none-any.whl (5.7 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size python-workq-0.1.tar.gz (4.3 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