faust.agents.actor

Actor - Individual Agent instances.

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

An actor is a specific agent instance.

mundane_level = 'debug'

The log level for mundane info such as starting, stopping, etc. Set this to "debug" for less information.

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: TP) None[source]

Call when an isolated partition is being revoked.

Return type:

None

async on_isolated_partition_assigned(tp: 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: str

Return human readable description of actor. :rtype: str

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

Used for agent function that yields.

traceback() str[source]
Return type:

str

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

Used for actor function that do not yield.

traceback() str[source]
Return type:

str

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