Skip to main content

lock the file when access local resource

Project description

https://travis-ci.org/yeyuexia/mono-require.svg?branch=master

Use mono-require to access local resource for avoid read/write conflict.

Requirements

  • Python 3.6+

  • Works on Linux, Windows, Mac OSX, BSD

Install

pip:

pip install mono-require

Usage

Use require to access local resource.

require support all arguments except closefd and opener of built-in method open (https://docs.python.org/3/library/functions.html?highlight=open#open).

And require have three more arguments with default value:

  • timeout=1 and delay=0.001. When require a resource has been used, require could waiting till timeout and throw LockTimeoutException.

  • lock_path=”.” to set the lock file location. By default we create lock file in resource directory.

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

mono-require-0.1.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file mono-require-0.1.tar.gz.

File metadata

  • Download URL: mono-require-0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mono-require-0.1.tar.gz
Algorithm Hash digest
SHA256 aa06a62ae71ddf78d2166838077e3d71c1464377eee6c607affdac2ed8e5ad27
MD5 7d240ead360dd643cdf4edaebd738a8d
BLAKE2b-256 9820b6bf3523ea41f1efed7b14346b169b14c93f89367e9daeb5683363583c73

See more details on using hashes here.

Supported by

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