https://github.com/hhatto/python-workq
Python Client for Workq (https://github.com/iamduo/workq)
https://github.com/hhatto/python-workq
Last synced: 3 months ago
JSON representation
Python Client for Workq (https://github.com/iamduo/workq)
- Host: GitHub
- URL: https://github.com/hhatto/python-workq
- Owner: hhatto
- License: mit
- Created: 2016-10-25T14:02:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-07T08:23:47.000Z (over 8 years ago)
- Last Synced: 2025-03-24T06:04:43.096Z (4 months ago)
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
python-workq
============Python Client for Workq_ with asyncio_ .
.. _Workq: https://github.com/iamduo/workq
.. _asyncio: https://docs.python.org/dev/library/asyncio.htmlRequirements
------------
* Python3.5+Usage
-----Enqueue Foreground Job
~~~~~~~~~~~~~~~~~~~~~~.. code-block:: python
import asyncio
import uuid
from workq.workq import WorkqClient
from workq.job import ForegroundJobdef 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 commandLinks
-----
* PyPI_
* GitHub_.. _PyPI: https://pypi.python.org/pypi/python-workq/
.. _GitHub: https://github.com/hhatto/python-workq