Skip to main content

Python Boilerplate contains all the boilerplate you need to create a Python package.

Project description

Welcome to gcs_lock_thing

image

Basic mutex lock implementation with Google Cloud Storage with ttl and exponential backoff

Features

  • Basic mutex lock in GCP

Credits

This package was created with Cookiecutter and the giswqs/pypackage project template.

Installation

Stable release

To install gcs-lock-thing, run this command in your terminal:

pip install gcs_lock_thing

This is the preferred method to install gcs-lock-thing, as it will always install the most recent stable release.

If you don't have pip installed, this Python installation guide can guide you through the process.

Usage

To use gcs-lock-thing in a project:

import gcs_lock_thing.lock as gcs

public_bucket_path = "data-trf-test-mutex-lock"
client = gcs.Client(bucket=public_bucket_path, lock_file_path="test-lock.txt", ttl=2)

# get lock
status = client.lock()

# free lock
client.free_lock()

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

gcs_lock_thing-0.0.6.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

gcs_lock_thing-0.0.6-py2.py3-none-any.whl (4.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file gcs_lock_thing-0.0.6.tar.gz.

File metadata

  • Download URL: gcs_lock_thing-0.0.6.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for gcs_lock_thing-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d6061352ce12e2a4de0fd7de7eb4d9a870f04b02601038ffae3aedfde1e4e14f
MD5 ad854e772d05fb5ffdf239614ba24bef
BLAKE2b-256 bf2bbab07e6b56ee9b598e6bdd6ff5df278c318a4d91a510e9363a4c968d0718

See more details on using hashes here.

File details

Details for the file gcs_lock_thing-0.0.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for gcs_lock_thing-0.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d0b12080c4f86c28257c414ba9376a67d23b7702a4e685811f1d4ef6b497293c
MD5 7774f64316d001890f58e1e854bfb192
BLAKE2b-256 72e96e8cb790a6f30663ac669efbe0bfa84043dfa50825bbd2d810f3b75d0b99

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