Skip to main content

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

Release files for external 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for external 0.0.1
File Size Uploaded
external-0.0.1.tar.gz 2.4 kB Details

Release files / external-0.0.1.tar.gz

Download URL external-0.0.1.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
79296497a6d404bc39cce7425ccde02f7c6798e09672acde7cfe57ef44b266c8
BLAKE2b-256 checksum
How to use checksums
8dd821c19c68c616cec27f3ea4c36c4516e56e997d862cfacaa4a5bbe46d19e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.8.0 tqdm/4.20.0 CPython/3.6.4

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page