faust.agents.actor

Actor - Individual Agent instances.

class faust.agents.actor.Actor(agent: faust.types.agents.AgentT, stream: faust.types.streams.StreamT, it: _T, index: int = None, active_partitions: Set[faust.types.tuples.TP] = None, **kwargs: Any) → None[source]

An actor is a specific agent instance.

mundane_level = 'debug'
async on_start() → None[source]

Call when actor is starting.

Return type

None

async on_stop() → None[source]

Call when actor is being stopped.

Return type

None

async on_isolated_partition_revoked(tp: faust.types.tuples.TP) → None[source]

Call when an isolated partition is being revoked.

Return type

None

async on_isolated_partition_assigned(tp: faust.types.tuples.TP) → None[source]

Call when an isolated partition is being assigned.

Return type

None

cancel() → None[source]

Tell actor to stop reading from the stream.

Return type

None

property label

Return human readable description of actor. :rtype: str

logger = <Logger faust.agents.actor (WARNING)>
class faust.agents.actor.AsyncIterableActor(agent: faust.types.agents.AgentT, stream: faust.types.streams.StreamT, it: _T, index: int = None, active_partitions: Set[faust.types.tuples.TP] = None, **kwargs: Any) → None[source]

Used for agent function that yields.

logger = <Logger faust.agents.actor (WARNING)>
class faust.agents.actor.AwaitableActor(agent: faust.types.agents.AgentT, stream: faust.types.streams.StreamT, it: _T, index: int = None, active_partitions: Set[faust.types.tuples.TP] = None, **kwargs: Any) → None[source]

Used for actor function that do not yield.

logger = <Logger faust.agents.actor (WARNING)>