Skip to main content
https://travis-ci.org/appstore-zencore/distlock-client.svg?branch=master https://img.shields.io/codecov/c/github/appstore-zencore/distlock-client.svg?style=flat-square

Distribute lock system’s client.

Install

pip install distlock-client

Usage

  1. Use Lock apis.

from distlock_client import Lock
from distlock_client import get_app_unique_name
from .services import do_something

def view01(request):
    lockName = "view01_lock"
    appid = get_app_unique_name()
    server = "http://127.0.0.1/"
    lock = Lock(appid, server)

    locked = lock.safe_acquire(lockName, 60)
    if locked:
        try:
            do_something()
        finally:
            lock.safe_release(lockName)
  1. Use with statement.

from distlock_client import Lock
from distlock_client import distlock
from distlock_client import get_app_unique_name
from .services import do_something

def view01(request):
    lockName = "view01_lock"
    appid = get_app_unique_name()
    server = "http://127.0.0.1/"
    lock = Lock(appid, server)
    with distlock(lock, lockName) as locked:
        if locked:
            do_something()

Misc

  1. Available servers.

  • django-distlock-server [python, django, database backend]

  • django-distlock-server-redis [python, django, redis backend]

Release files for distlock-client 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for distlock-client 0.1.1
File Size Uploaded
distlock-client-0.1.1.tar.gz 2.5 kB Details

Release files / distlock-client-0.1.1.tar.gz

Download URL distlock-client-0.1.1.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
545c5e80e7986c216f66d7b091b203692eab9b09a2488cd0b887a8a8a0ddae7a
BLAKE2b-256 checksum
How to use checksums
5b455f618cecba49d854d583d6c08f4072367fdf8d78ed3b781a2c2d7886571c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page