Actor model for Python
Project description
splut
Actor model for Python.
This README is auto-generated, see project wiki for details.
API
splut.actor
Spawn Objects
class Spawn()
__init__
def __init__(executor)
Spawned actors will use threads from the given executor.
__call__
def __call__(*objs)
Create an actor backed by the given worker object(s), each of which is used in a single-threaded way.
Calling a method on the returned actor returns a Future immediately, which eventually becomes done with the result of a worker method of the same name (or never if the worker method hangs).
A worker method may be async, in which case it can await futures returned by other actors, releasing the worker in the meantime.
Join Objects
class Join()
Make multiple futures awaitable as a unit. In the zero futures case this resolves (to an empty list) without suspending execution. Otherwise if any future hangs, so does this. Otherwise if any future failed, all such exceptions are raised as a chain. Otherwise all results are returned as a list.
splut.actor.future
Future Objects
class Future()
wait
def wait()
Block until there is an outcome, then return/raise it.
For use outside actors, or within one if you know the future is done and don't want to suspend execution with await in that case.
andforget
def andforget(log)
Send any exception to the given log.
splut.bg
Sleeper Objects
class Sleeper()
interrupt
def interrupt()
If a sleep is in progress that sleep returns now, otherwise the next sleep will return immediately. This is similar behaviour to interrupting a maybe-sleeping thread in Java.
splut.bg.delay
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file splut-21.tar.gz.
File metadata
- Download URL: splut-21.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce04a5054912350a8060e83c1ad8460bcb7a0b711f3f2384a27eae78a43a69b5
|
|
| MD5 |
3a316c370e7d92285f3057000f6058bf
|
|
| BLAKE2b-256 |
de5731157416b4404b075b2b10e0acf88b50504e9aedac7cfb9e85759cf72c15
|
File details
Details for the file splut-21-py3-none-any.whl.
File metadata
- Download URL: splut-21-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3f4c41ae835ab7cc5af82f2f37b303ae9142dc14ce4e4f252b332855ba4905a
|
|
| MD5 |
23e1c65794aad7868d9206d1de680daa
|
|
| BLAKE2b-256 |
a917e6dba82b58fb9cbc666572fec0c4db2d874e87f5cf10c9888815d67f201e
|