Skip to main content

Python implementation of Haskell's Control.Concurrent.MVar

Project description

# pyhton-mvar

[![PyPI version](https://badge.fury.io/py/mvar.svg)](https://badge.fury.io/py/mvar) [![Build Status](https://travis-ci.com/gabrik/mvar-python.svg?branch=master)](https://travis-ci.com/gabrik/mvar-python) [![codecov](https://codecov.io/gh/gabrik/mvar-python/branch/master/graph/badge.svg)](https://codecov.io/gh/gabrik/mvar-python)

A Pyhton port of Haskell’s [Control.Concurrent.MVar](https://hackage.haskell.org/package/base/docs/Control-Concurrent-MVar.html).

This implementation blocks on get if the MVar is empty, and on put if the MVar is not empty.

A MVar is a mutable location which can either be empty, or contain a value. The location can be written to and read from safely from multiple concurrent python threads.

### Installation

pip3 install mvar

### Example

A brief example with 3 threads and one MVar is available in [example](example/example.py)

Copyright 2018 Gabriele Baldoni

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

mvar-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

mvar-1.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file mvar-1.0.0.tar.gz.

File metadata

  • Download URL: mvar-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.8.5

File hashes

Hashes for mvar-1.0.0.tar.gz
Algorithm Hash digest
SHA256 db506763ee1f2ba8b47b4e15f88c369d074288a95c8623d900ecba97acd2412f
MD5 dcc408560cb8479d5ae5382f18b0773f
BLAKE2b-256 b6a93b093fd65970833195dec17f5e38f1a578cd3ef32a25cb3f78b2d777727c

See more details on using hashes here.

File details

Details for the file mvar-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mvar-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.8.5

File hashes

Hashes for mvar-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61d22268db86ea7a9b79419e1b189b989a163418606a6d9084d9028fdc48075a
MD5 e2543a8604f2d879e25a5d5a907b1825
BLAKE2b-256 6cc52ddcf5c9a75226f58c47ee15c6848c536b75e69aa895a3dba35b480d1176

See more details on using hashes here.

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