Skip to main content

Actions Status codecov

Async Redis Objects

Some object orient wrappers around the redis interface provided by aioredis.

Notes

  • Included:
    • hash table
    • queue (list)
    • priority queue (sorted set)
  • Includes python implementation with matching interface for mocking.
    from async_redis_objects.mocks import ObjectClient
  • tested on pypy and CPython 3.6 to 3.8
  • API documentation on read the docs

Example

import aioredis
import asyncio
from async_redis_objects import ObjectClient


async def main():
    # Connect with aioredis as normal
    redis = aioredis.Redis(await aioredis.pool.create_pool(address='redis://redis:6379', db=3, minsize=5))

    # Make an object client object with your redis object
    objects = ObjectClient(redis)

    # Access a hash table in redis
    table = objects.hash('hash-table-key')
    await table.set('name', 'Hello World')

    # Access a queue
    queue = objects.queue('queue-name')
    await queue.push(await table.get('name'))
    await queue.push(100000)

    # Access a priority queue
    pq = objects.priority_queue('other-queue-name')
    await pq.push({'name': 'same json serializable object'}, priority=100)
    await pq.push(await queue.pop(), priority=101)
    print(await pq.pop())  # Print Hello World

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

async_redis_objects-0.1.3.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

async_redis_objects-0.1.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file async_redis_objects-0.1.3.tar.gz.

File metadata

  • Download URL: async_redis_objects-0.1.3.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for async_redis_objects-0.1.3.tar.gz
Algorithm Hash digest
SHA256 81b99f98d947bc5507f2554995666078d3d02a9daf72e3a43f56a191060c2689
MD5 eb722af978e5b6bbdc5c3243f4e636bf
BLAKE2b-256 80a732ecebff09966dedc084aed123dcdcb21098720b829420fb309da42ed2bb

See more details on using hashes here.

File details

Details for the file async_redis_objects-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: async_redis_objects-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for async_redis_objects-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fc796e7646f02de05920e1639c7fadbfce80173596bae1204097bb435538b37c
MD5 b345d14c18cb45787019d0bbe3380f7b
BLAKE2b-256 bcbdb81770b55e14b5b2e972e10b34e6b70ef70391d9f057b9de658d7fd2abcc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page