Skip to main content

No project description provided

Project description

PG MUTEX

Python wrapper around Postgres pg_advisory_lock and pg_try_advisory_lock functions. It is possible, thanks to a common connection to the database, to block certain pieces of python code by different python processes, on different nodes.

Installation

pip install pg-mutex

Usage

from mutex import mutex

with mutex(connection, ['param1', 'param2']):
    # here is code that is guaranteed to be executed by only one process, even on different nodes
    pass

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

pg-mutex-1.0.1.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

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

pg_mutex-1.0.1-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file pg-mutex-1.0.1.tar.gz.

File metadata

  • Download URL: pg-mutex-1.0.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for pg-mutex-1.0.1.tar.gz
Algorithm Hash digest
SHA256 499bbae0a49b5e5b79430dd2daa2dae71020b2d81554d715831a95aaaf20256d
MD5 b73d0b75d2bf68091e55fffd280c6963
BLAKE2b-256 a5d6b73446d7fb2045729b87a464b6478395119523097028d9719e0df872205f

See more details on using hashes here.

File details

Details for the file pg_mutex-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pg_mutex-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for pg_mutex-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4cbe7641920bd0154d101064e540a98820487e26fb9512491ecda87826698564
MD5 952c759ad887a09efd3211a113a52a60
BLAKE2b-256 3a393d47d46c09b2787a9ea492ce381890a9fe8fbcc587323da9e84310c24eba

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