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 debouncemaster 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.2.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.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file debounce_redis_guard-0.0.2.tar.gz.

File metadata

  • Download URL: debounce_redis_guard-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 d89140e2b1a8f7dd54e1505a00a63f02d5b896f533b4dff9e8a2b96d124fc64d
MD5 c97d72867364b1eb4d6fbd5b6863cfe7
BLAKE2b-256 6b14086a3ce5bc6db75bc3f5fb8d549ae9a83027a77576f0bc0cc5166e627111

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for debounce_redis_guard-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 baafa52acdd26bc3036f63e94c303ad7e9cac95f072aca895fe40a17683245d3
MD5 8764064722e6bb9b9e267c87b5172c81
BLAKE2b-256 e11a2d19560669bc869062865cfc1539aa546e3bc5cdfc87eb6c6301039bbe81

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