GitHub - auvipy/cell: actor framework for Kombu (original) (raw)

cell - Actor framework

Version: 0.0.3

Synopsis

cell is an actor framework for Kombu and celery .

What is an Actor

The actor model was first proposed by Carl Hewitt in 1973 [1] and was improved, among others, by Gul Agha [2].

An Actor is an entity (a class in cell), that has a mailbox and a behaviour. Actors communicate between each other only by exchanging messages. Upon receiving a message, the behaviour of the actor is executed, upon which the actor can send a number of messages to other actors, create a number of actors or change its internal state.

Cell supports:

Why should I use it?

In a nutshell:

if you are a celery user:

(You can program with classes and not tasks)

You can control the execution per actor/not per worker.

adder.send.add(2, 2) adder.send.add(2, 2)

If you are a general Pythonist

Having a framework for distributed actor management in your toolbox is a must, bacause:

Installation

You can install cell either via the Python Package Index (PyPI) or from source.

To install using pip,:

$ pip install cell

To install using easy_install,:

$ easy_install cell

If you have downloaded a source tarball you can install it by doing the following,:

$ python setup.py build

python setup.py install # as root

Quick how-to

If you are too impatient to start, here are the 3 quick steps you need to run 'Hello, world!' in cell: (You can also check the Demo video)

from cell.actors import Actor

class GreetingActor(Actor): class state: def greet(self, who='world'): print 'Hello %s' % who

celery worker -b 'pyamqp://guest@localhost'

from cell.agents import dAgent from kombu import Connection from examples.greeting import GreetingActor

connection = Connection('amqp://guest:guest@localhost:5672//') agent = dAgent(connection) greeter = agent.spawn(GreetingActor) greeter.call('greet')

The full source code of the example from :py:mod:`examples` module. To understand what is going on check the :ref:`Getting started ` section.

Getting Help

Mailing list

Join the celery-users mailing list.

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to our issue tracker at http://github.com/celery/cell/issues/

Contributing

Development of cell happens at Github: http://github.com/celery/cell

You are highly encouraged to participate in the development. If you don't like Github (for some reason) you're welcome to send regular patches.

License

This software is licensed under the New BSD License. See the LICENSE file in the top distribution directory for the full license text.

Copyright (C) 2011-2013 GoPivotal, Inc.

cell as part of the Tidelift Subscription

The maintainers of cell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/pypi-cell?utm_source=pypi-cell&utm_medium=referral&utm_campaign=readme&utm_term=repo)