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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page