{ "info": { "author": "Pedro Garcia Lopez & Edgar Zamora Gomez & Ruben Mondejar Andreu", "author_email": "pedro.garcia@urv.cat, edgar.zamora@urv.cat", "bugtrack_url": null, "classifiers": [], "description": "# PyActive \n\n\n## Description \n\n\nPyActive is a novel object oriented implementation of the Actor model in Python. \nWhat it is novel in our approach is the tight integration with OO concepts that \nconsiderably simplifies the use of this library. \n\nIn particular, PyActive provides non-blocking synchronous invocations in Actors. Unlike \ntraditional Actor frameworks that only provide asynchronous calls, our library offers \nsynchronous non-blocking calls that respect and maintain the message-passing concurrency model.\nTo this end, we have implemented a variant of the Active Object pattern using both Threads and \nmicro-Threads (Stackless). We demonstrate in complex examples like the Chord overlay that our approach \nreduces substantially the complexity and Lines of Code (LoC) of the problem.\n\nPyActive follows a pure object oriented approach for method invocation. \nOther actor frameworks use special notations (!) for sending messages \nand pattern matching or conditionals to receive them. Instead of that, Pyactive\nmiddleware transparently maps messages to methods and thus achieving better \ncode expressiveness.\n\nPyActive also includes advanced abstractions like remote reference passing, one-to-many invocation abstractions, and\nexception handling to ease the implementation of distributed algorithms. PyActive is also a distributed object middleware \nand it offers remote dispatchers enabling remote method invocation. Finally, PyActive's log mechanisms can generate UML sequence diagrams\nthat help to understand the interactions among Actors using a OO aproach.\n\nPyActive is now provided in two platforms: using cooperative microthreads on top of Stackless Python and on top of python threads\nusing the standard threading library. We validated the performance and expressiveness of Pyactive to code distributed algorithms.\n\n\n\n## Basic method abstractions\n\n\n* **async**: It\u2019s used to indicate the method can receive asynchronous remote calls.\n\n* **sync**: It\u2019s used to indicate the method can receive synchronous remote calls.\n So it\u2019s necessary to return something.\n\n* **parallel**: It guarantees that the current method will not be blocked in a synchronous call by launching an additional thread of control. Our library ensures that no concurrency conflicts arise by ensuring that only one thread at a time can access the Passive Object.\n\n* **ref**: It\u2019s used to activate the remote reference layer in this method. This means that one parameter or result are Actors. So this annotation guarantees pass-by-reference.\n\n\n## Basic Functions \n\n* **start_controller**: It's used to choose the module. At this moment, we can choose \n between 'atom_thread' and 'tasklet'. Note that this decision can change the \n python version that you need. For example the 'tasklet' module needs Stackless Python. \n \n* **launch**: It's used to throw the main function which initializates the program. Once this function ends, the program will die.\n\n* **serve_forever**. It\u2019s used like launch function but once the function ends, the program continues.\n\n\n## How to use PyActive? \n\n\nIn this section we explain all you need to use this middleware. It's easy!\n\n**Requirements**\n* If you only use the threads module, you only need Python 2.7\n\n* If you need use the stackless version, you need Python 2.7 with \n Stackless Python\n\nYou can download Python in: http://www.python.org/download/ \n\nOnce you have installed python, the next step is to install Stackless python.\nYou can download Stackless python at: [http://www.stackless.com/]\n\n\nPyActive contains some examples and tests. You can run the following tests:\n\n $> cd/pyactive\n $> python ./examples/Hello_World/test_async.py\n $> python ./examples/registry/first.py\n\nChoose the module using the function: 'start_controller'. Nowadays, \nyou can put either the parameter 'tasklet' or 'atom_thread' to choose the module.\nNote that you choose the tasklet module, you need the Stacklees Python. \n\n\n## Perspectives uses and future work \n\n\n* **Simulation and implementation of distributed algorithms**: Pyactive can \n considerably simplify the development of distributed algorithms. It is \n possible to simulate algorithms in a single machine before they are \n deployed in an experimentation testbed. We implemented Chord in the past \n for an event-based traditional p2p simulator (PlanetSim) and the code is \n complex to understand and follow. On the other hand, our implementation \n using Pyactive is more succinct, and quit similar to the original algorithms \n proposed in the Chord paper. The main reason is that Pyactive clearly separates \n communication code from algorithm code inside methods. We plan to use Pyactive \n in our distributed systems course and in our peer-to-peer and networking courses.\n\n* **Web middleware**: Pyactive has a big potential to ease the development of REST \n and Web RPC platforms. Web asynchronous networking libraries that use green \n threads. We are even considering to create a novel version of Pyactive on top of\n one these libraries. In particular, we plan to rewrite some server code of the\n OpenStack Swift is based on WSGI python servers that already use green threads\n to improve the performance. But the current code is tangling communication, \n marshalling and distributed storage algorithms. Pyactive can decouple these layers\n and make the code performance and easy to understand ans modify\n\n* **Multi-core programming**: One of the promises of message passing concurrency \n is the future of multi-core concurrency programming. Erlang offers truly \n parallelism over different cores with Symmetric Multi-Processing(SMP). They mainly \n added multi-threading support to the Erlang VM, so that different lightweight \n process schedulers can live inside their native threads. In our case, stackless \n also permits to have different microthreads living inside their own thread or \n process. But python threads do not benefit from multi-core programming due to \n the GIL (Global Interpreter lock). Instead of that, we could support multi-core \n programming using the python multiprocessing library.\n\n* **Distributed continuations**: We outline an important future work with the \n combination of RPCs and distributed continuations in Pyactive. Stackless python \n permits to serialize microthreads in their current frames. It is thus feasible\n to create novel call abstractions supporting distributed continuations between\n different hosts.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://ast-deim.urv.cat/pyactive", "keywords": null, "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "PyActive", "package_url": "https://pypi.org/project/PyActive/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/PyActive/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://ast-deim.urv.cat/pyactive" }, "release_url": "https://pypi.org/project/PyActive/1.0/", "requires_dist": null, "requires_python": null, "summary": "Active Object Middleware", "version": "1.0" }, "last_serial": 943841, "releases": { "1.0": [] }, "urls": [] }