https://github.com/himenon/hakka-py
Container Oriented Worker
https://github.com/himenon/hakka-py
asynctask redis taskqueue worker
Last synced: 6 months ago
JSON representation
Container Oriented Worker
- Host: GitHub
- URL: https://github.com/himenon/hakka-py
- Owner: Himenon
- License: mit
- Created: 2018-02-21T14:57:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-04T06:56:27.000Z (over 5 years ago)
- Last Synced: 2025-02-15T19:30:48.784Z (10 months ago)
- Topics: asynctask, redis, taskqueue, worker
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
============
hakka-py
============
.. image:: https://img.shields.io/pypi/v/hakka.svg
:target: https://pypi.python.org/pypi/hakka
.. image:: https://img.shields.io/travis/Himenon/hakka-py.svg
:target: https://travis-ci.org/Himenon/hakka-py
.. image:: https://readthedocs.org/projects/hakka-py/badge/?version=latest
:target: https://hakka-py.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https:/ /pyup.io/repos/github/Himenon/hakka-py/shield.svg
:target: https://pyup.io/repos/github/Himenon/hakka-py/
:alt: Updates
Small Task Queue
* Free software: MIT license
* Documentation: .
Usage
=====
.. code-block:: bash
$ pip install hakka
**Worker**
.. code-block:: python
from hakka import Hakka
app = Hakka()
@app.watch('hello:msg')
def hello_msg(name=None, msg=None, **kwargs):
print("Hello {name}!, {msg}".format(name=name, msg=msg))
app.listen('localhost', 6379, 0, debug=True)
**Sender**
.. code-block:: python
from hakka import HakkaRedisClient
if __name__ == '__main__':
client = HakkaRedisClient()
message = {
"name": "hakka",
"reading": "books"
}
for i in range(10):
message.update({
"msg": "Hello World x {}!".format(i),
})
client.set_value('hello:msg', message)
.. code-block:: bash
$ redis-cli lpush hello:msg '{"name": "yourname", "msg": "Congratulation!"}'
How to Develop
==============
Using: Docker, docker-compose
.. code-block:: bash
$ docker-compose up
# start pytest-watch