This document describes cell 0.0. For development docs, go here.

cell.agents

cell.agents

class cell.agents.Agent(connection, id=None, actors=None)
actors = []
get_consumers(Consumer, channel)
get_default_scatter_limit(actor)
on_consume_ready(*args, **kwargs)
on_run()
prepare_actors()
run()
run_from_commandline(loglevel='INFO', logfile=None)
stop()
class cell.agents.dAgent(connection, id=None)
MAX_ACTORS = 2
get_default_scatter_limit()
is_green()
kill(actor_id, nowait=False)
process_message(actor, body, message)

Process actor message depending depending on the the worker settings.

If greenlets are enabled in the worker, the actor message is processed in a greenlet from the greenlet pool, Otherwise, the message is processed by the same thread. The method is invoked from the callback cell.actors.Actor.on_message

upon receiving of a message.
Parameters:actor – instance of Actor or its derivative.

The actor instance to process the message.

For the full list of arguments see cell.actors.Actor._on_message().

select(cls, **kwargs)

Get the id of already spawned actor

Parameters:actor – the name of the Actor class
shutdown()
spawn(cls, kwargs={}, nowait=False)

Spawn a new actor on a celery worker by sending a remote command to the worker.

Parameters:
  • cls – the name of the Actor class or its derivative.
  • kwargs – The keyword arguments to pass on to actor __init__ (a dict)
  • nowait – If set to True (default) the call waits for the result of spawning the actor. if False, the spawning is asynchronous.
:returns ActorProxy:,
holding the id of the spawned actor.
spawn_group(group, cls, n=1, nowait=False)
start()
class state
kill(actor_id)
reset()
select(cls)
spawn(cls, id, kwargs={})

Add actor to the registry and start the actor’s main method.

stop_all()
dAgent.stop()
dAgent.types = ('round-robin', 'scatter', 'direct')