Skip to main content

Request/Response library on top of Redis.

Project description

Python package Supported Versions PyPI

reds

Request/Response library on top of Redis.

Simple Client/Server example

Client:

from redis import StrictRedis
from reds import Reds


def main():
    key = 'test:queue'
    redis = StrictRedis()
    reds = Reds(redis=redis, key=key)
    for i in range(10):
        task = reds.create_task(task_dict={
            'id': i
        })
        print(task.send())


if __name__ == '__main__':
    main()

Server:

import time
from random import random

from redis import StrictRedis
from reds import Reds


def main():
    key = 'test:queue'
    redis = StrictRedis()
    reds = Reds(redis=redis, key=key)
    for task in reds.listen():
        print(task)
        time.sleep(1)
        task.respond(task_dict={
            'success': random() > 0.5
        })


if __name__ == '__main__':
    main()

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

reds-0.1.9.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

reds-0.1.9-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file reds-0.1.9.tar.gz.

File metadata

  • Download URL: reds-0.1.9.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for reds-0.1.9.tar.gz
Algorithm Hash digest
SHA256 fa53f49c850e7d3e8087db1997a462626d589f40d621501e55bf4dbaa937450d
MD5 84dfbc27c1feac106c3a04a72371bcea
BLAKE2b-256 3a5ac11588790dec3bb2241c0e01bef252c13382024fbc3bfd614122a735b1f2

See more details on using hashes here.

File details

Details for the file reds-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: reds-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for reds-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 554e57546d3eb0cf61b8c0d46be9b27aff3164ef9d00d8d5affb931b54eff5e2
MD5 d4c1715069b9949678f64092845e41af
BLAKE2b-256 0dcbda98d72c0655e3acb813a751da5f6bb0f3ea700184a29cf8af3f357a1857

See more details on using hashes here.

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