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.

Files for mvar, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size mvar-1.0.0-py3-none-any.whl (8.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size mvar-1.0.0.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page