Skip to main content

Run tasks on external processes to overcome Python's global interpreter lock.

Project description

Run tasks on external processes to overcome Python's global interpreter lock.

Inspired by google-research/batch-ppo ExternalProcess

Installation

pip install external

Usage

import external

@external
class Counter():

    def __init__(self, count=0):
        self.count = count

    def increment(self):
        self.count += 1

with Counter(count=1) as c:
    assert c.count.get() == 1
    c.increment()
    assert c.count.get() == 2
    try:
        c.decrement()
    except AttributeError as e:
        print(e)  # 'Counter' object has no attribute 'decrement'
    assert c.count.get() == 2

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 external, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size external-0.0.1.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page