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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | db506763ee1f2ba8b47b4e15f88c369d074288a95c8623d900ecba97acd2412f |
|
MD5 | dcc408560cb8479d5ae5382f18b0773f |
|
BLAKE2b-256 | b6a93b093fd65970833195dec17f5e38f1a578cd3ef32a25cb3f78b2d777727c |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61d22268db86ea7a9b79419e1b189b989a163418606a6d9084d9028fdc48075a |
|
MD5 | e2543a8604f2d879e25a5d5a907b1825 |
|
BLAKE2b-256 | 6cc52ddcf5c9a75226f58c47ee15c6848c536b75e69aa895a3dba35b480d1176 |