Print

Description

PyActive is a novel object oriented implementation of the Actor model in Python. What it is novel in our approach is the tight integration with OO concepts that considerably simplifies the use of this library.

In particular, PyActive provides non-blocking synchronous invocations in Actors. Unlike traditional Actor frameworks that only provide asynchronous calls, our library offers synchronous non-blocking calls that respect and maintain the message-passing concurrency model. To this end, we have implemented a variant of the Active Object pattern using both Threads and micro-Threads (Stackless). We demonstrate in complex examples like the Chord overlay that our approach reduces substantially the complexity and Lines of Code (LoC) of the problem.

PyActive follows a pure object oriented approach for method invocation. Other actor frameworks use special notations (!) for sending messages and pattern matching or conditionals to receive them. Instead of that, Pyactive middleware transparently maps messages to methods and thus achieving better code expressiveness.

PyActive also includes advanced abstractions like remote reference passing, one-to-many invocation abstractions, and exception handling to ease the implementation of distributed algorithms. PyActive is also a distributed object middleware and it offers remote dispatchers enabling remote method invocation. Finally, PyActive's log mechanisms can generate UML sequence diagrams that help to understand the interactions among Actors using a OO aproach.

PyActive is now provided in two platforms: using cooperative microthreads on top of Stackless Python and on top of python threads using the standard threading library. We validated the performance and expressiveness of Pyactive to code distributed algorithms.

Basic method abstractions

Basic Functions

What do you need to run PyActive?

In this section we explain all you need to use this middleware. It's easy!

Into Pyactive_Project folder you can find how to install the middleware in INSTALL.txt.

Requirements

You can download Python in: http://www.python.org/download/

Once you have installed python, the next step is to install Stackless python. You can download Stackless python at: [http://www.stackless.com/]

PyActive contains some examples and tests. You can run the following tests:

    $> cd/pyactive
    $> python ./examples/hello_world/hello_world_sync.py
    $> python ./examples/hello_world/hello_world_async.py

Choose the module using the function: 'start_controller'. Nowadays, you can put either the parameter 'tasklet' or 'pyactive_thread' to choose the module. Note that you choose the tasklet module, you need the Stacklees Python.