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)
| 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
|