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.
ManualExecutor Objects
class ManualExecutor()
Utilise the main (or any other) thread directly.
run
def run()
Execute tasks until interrupted. Typical usage is for the main thread to call this after setting up the system.
putinterrupt
def putinterrupt()
Cause exactly one thread to exit the run method soon.
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
Release files for splut 22
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| splut-22.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| splut-22-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.3 kB
Release files / splut-22.tar.gz
| Download URL | splut-22.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81cd761f261dd0b719bdeabb1283f1843464d14363bfa66bbad85a9a8ca81435
|
|
BLAKE2b-256 checksum How to use checksums |
c18647f8deb18059f7d083531a970b643b2dc1698f3848d68033b4dbc0b54685
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / splut-22-py3-none-any.whl
| Download URL | splut-22-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a6c1680db9a847ceb609a34b93d4cf95f77d29f0755da965046bb1baec95a61
|
|
BLAKE2b-256 checksum How to use checksums |
8fd6d05c05ea3c215ff0b208e715d0988459852802eb8284ca1bfb56741dcb4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|