Skip to main content

A Python library for debouncing requests with support for multiple workers.

Project description

debounce-redis-guard

DebounceMaster is a Python library designed to handle debouncing of requests in applications that support multiple workers. This library helps to prevent multiple identical requests from being processed simultaneously, thus improving efficiency and reducing redundant processing.

Features

  • Debounce requests to avoid duplicate processing
  • Supports multiple workers
  • Integration with Redis for distributed locking and caching
  • Custom logging

Installation

pip install debounce-redis-guard

Initialize Debouncer with logger and Redis configuration


from debounce-redis-guard import Debouncer, RedisConfig

debouncer = Debouncer(logger=my_logger, redis_config=my_redis_config)

Usage

@debouncer.debounce(ttl=60, function_name='my_function', identity_name='data')
async def my_function(data):
    # Your function logic here
    return {'message': 'Processed'}
    

Example Usage

@router.get("/perform-final-payment", , name="final payment perform by users - should only call one time.")
@debouncer.debounce(ttl=599, function_name="getAllPaymentGatewayList")
async def finalPay():

    response = code functionality
    return response

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

debounce-redis-guard-0.0.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

debounce_redis_guard-0.0.3-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file debounce-redis-guard-0.0.3.tar.gz.

File metadata

  • Download URL: debounce-redis-guard-0.0.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for debounce-redis-guard-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ee0744dbef320b516f9065220a38f108823c3b582af4a79705386ae0a41f92c9
MD5 fc65d74a0a0fed73119ceedfee36a068
BLAKE2b-256 9ebad21804a42ce000c1d50195b3f2ed216310093434652cd02afcaf195f0188

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for debounce_redis_guard-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 548de6d7063f7da9b41f18ef362a251a13fb0defb48d0dce3447646a001d6a81
MD5 05592db94043efa138ec59aaa2781304
BLAKE2b-256 7d0d89339b182c53c5b568a5c25b3c37f323cadc5821ba52658e80c88f2ce05b

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 Pingdom Monitoring Sentry Error logging StatusPage Status page