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

Example

import aioredis
import asyncio
from async_redis_objects.mocks import ObjectClient


async def main():
    # Connect with aioredis as normal
    redis = aioredis.Redis(await aioredis.pool.create_pool(address='redis://localhost: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.0.3.tar.gz (4.2 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.0.3-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: async_redis_objects-0.0.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for async_redis_objects-0.0.3.tar.gz
Algorithm Hash digest
SHA256 456898ae7debfaab4372e04164c296c7da425d558458aac097c0a91e623a137b
MD5 1dd14bdb7acc5a2f595378a17f76bff5
BLAKE2b-256 45131b426d02319a53e8d74970ac07e3b882bfa9581e0d16d05f8b879ded76e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: async_redis_objects-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for async_redis_objects-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7e861de468367bf433654e20cee4e0b2d049c055273e5395f3fee5416ce459b5
MD5 d82b8bea1ea0f0f98d569e0eba8322c1
BLAKE2b-256 e84e7f32aab0200de32855fc043c41f679467e0002b5d1420dfe4d943ef6de89

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