Skip to main content

Tiny Actor Run-Time in Python.

Project description

Python implementation of the Actor Model inspired from tart.js.

Overview

The initial ideas for tartpy are copied from @dalnefre and @tristanls. At the beginning, the goal was to replicate tart.js in Python. Lately, it has diverged slightly, to experiment with the new Python asynchrony model introduced in version 3.4.

tartpy aims to be an actor library with the following features:

  • it implements the pure actor model (rather than the Erlang model),

  • it can be used in practical situations to express lock-free and concurrent algorithms,

  • it abstracts the network transport to allow arbitrary protocols,

  • it implements a capability based approach to isolate actors, using membranes (again, the ideas are due to @dalnefre and @tristanls). The semantics of membranes may differ between tartpy and tartjs.

Installing

Install with:

$ pip install git+https://github.com/waltermoreira/tartpy

or clone this repository and install with python3 setup.py install:

$ git clone https://github.com/waltermoreira/tartpy
$ cd tartpy
$ python3 setup.py install

Test

Run tests with:

$ python3 setup.py test

Examples

Run example with:

python3 tartpy/example.py

There is also an IPython notebook showing the basic properties of actors.

The project actor_model contains slides and IPython notebooks from a talk presented at TACC in April 17, 2014.

Erlang Challenge

Create a ring of M actors, sending N messages around the ring:

python3 tartpy/erlang_challenge.py M N

Benchmarks

For M = 100000 and N = 10:

Starting 100000 actor ring
Construction time: 1.5192079544067383 seconds
Loop times:
  0.7743091583251953 seconds
  0.7793149948120117 seconds
  0.7702958583831787 seconds
  0.7602570056915283 seconds
  0.7704610824584961 seconds
  0.779731035232544 seconds
  0.7654228210449219 seconds
  0.7625432014465332 seconds
  0.7740719318389893 seconds
  0.7699680328369141 seconds
Average: 0.7706375122070312 seconds

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tartpy-0.2.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

tartpy-0.2.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file tartpy-0.2.1.tar.gz.

File metadata

  • Download URL: tartpy-0.2.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tartpy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b6341c6f7d4abe4b20facaa11b65ac23bea84c5c53b2f2301bb3db4604cdfe72
MD5 8fb1b817c23e0d06cb280a8c0d5d3c8f
BLAKE2b-256 c9725639c9dfe4fd9dd03fdf71917043fc653ba22f5752a6623c99e06e859495

See more details on using hashes here.

File details

Details for the file tartpy-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tartpy-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab471e6fd0d2b0c31c2da4c30ab432227488f2168d8c1f4c32fd89e30ede9365
MD5 b6a3812680a0eaf8cd9ae1dc8f0da076
BLAKE2b-256 5fb963bd6320d0f56ba0837b54adaf09fe6aa961d1e49e8e044b7b6d5874259c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page