faust.types.app

class faust.types.app.AppT(id: str, *, monitor: faust.types.app.Monitor, config_source: Any = None, **options) → None[source]

Abstract type for the Faust application.

See also

faust.App.

finalized = False

Set to true when the app is finalized (can read configuration).

configured = False

Set to true when the app has read configuration.

rebalancing = False

Set to true if the worker is currently rebalancing.

unassigned = False
on_configured(sender: T_contra = None, *args, **kwargs) → None = <SyncSignal: AppT.>
on_before_configured(sender: T_contra = None, *args, **kwargs) → None = <SyncSignal: AppT.>
on_after_configured(sender: T_contra = None, *args, **kwargs) → None = <SyncSignal: AppT.>
on_partitions_assigned(sender: T_contra = None, *args, **kwargs) → None = <Signal: AppT.>
on_partitions_revoked(sender: T_contra = None, *args, **kwargs) → None = <Signal: AppT.>
on_rebalance_complete(sender: T_contra = None, *args, **kwargs) → None = <Signal: AppT.>
on_before_shutdown(sender: T_contra = None, *args, **kwargs) → None = <Signal: AppT.>
on_worker_init(sender: T_contra = None, *args, **kwargs) → None = <SyncSignal: AppT.>
config_from_object(obj: Any, *, silent: bool = False, force: bool = False) → None[source]
Return type:None
finalize() → None[source]
Return type:None
main() → None[source]
Return type:None
worker_init() → None[source]
Return type:None
discover(*extra_modules, categories: Iterable[str] = ('a', 'b', 'c'), ignore: Iterable[str] = ('foo', 'bar')) → None[source]
Return type:None
topic(*topics, pattern: Union[str, Pattern[~AnyStr]] = None, key_type: faust.types.app.ModelArg = None, value_type: faust.types.app.ModelArg = None, key_serializer: Union[faust.types.codecs.CodecT, str, None] = None, value_serializer: Union[faust.types.codecs.CodecT, str, None] = None, partitions: int = None, retention: Union[datetime.timedelta, float, str] = None, compacting: bool = None, deleting: bool = None, replicas: int = None, acks: bool = True, internal: bool = False, config: Mapping[str, Any] = None, maxsize: int = None, allow_empty: bool = False, loop: asyncio.events.AbstractEventLoop = None) → faust.types.topics.TopicT[source]
Return type:TopicT[]
channel(*, key_type: faust.types.app.ModelArg = None, value_type: faust.types.app.ModelArg = None, maxsize: int = None, loop: asyncio.events.AbstractEventLoop = None) → faust.types.channels.ChannelT[source]
Return type:ChannelT[]
agent(channel: Union[str, faust.types.channels.ChannelT] = None, *, name: str = None, concurrency: int = 1, supervisor_strategy: Type[mode.types.supervisors.SupervisorStrategyT] = None, sink: Iterable[Union[AgentT, faust.types.channels.ChannelT, Callable[Any, Optional[Awaitable]]]] = None, isolated_partitions: bool = False, **kwargs) → Callable[Callable[Union[AsyncIterator, faust.types.streams.StreamT], Union[Awaitable, AsyncIterable]], faust.types.agents.AgentT][source]
Return type:Callable[[Callable[[Union[AsyncIterator[+T_co], StreamT[+T_co]]], Union[Awaitable[+T_co], AsyncIterable[+T_co]]]], AgentT[]]
task(fun: Union[Callable[AppT, Awaitable], Callable[Awaitable]]) → Callable[source]
Return type:Callable
timer(interval: Union[datetime.timedelta, float, str], on_leader: bool = False) → Callable[source]
Return type:Callable
crontab(cron_format: str, *, timezone: datetime.tzinfo = None, on_leader: bool = False) → Callable[source]
Return type:Callable
service(cls: Type[mode.types.services.ServiceT]) → Type[mode.types.services.ServiceT][source]
Return type:Type[ServiceT[]]
stream(channel: AsyncIterable, beacon: mode.utils.types.trees.NodeT = None, **kwargs) → faust.types.streams.StreamT[source]
Return type:StreamT[+T_co]
Table(name: str, *, default: Callable[Any] = None, window: faust.types.windows.WindowT = None, partitions: int = None, help: str = None, **kwargs) → faust.types.tables.TableT[source]
Return type:TableT[~KT, ~VT]
page(path: str, *, base: Type[faust.types.web.View] = <class 'faust.types.web.View'>, name: str = None) → Callable[Union[Type[faust.types.web.View], Callable[[faust.types.web.View, faust.types.web.Request, Any, Any], Awaitable[faust.types.web.Response]]], Type[faust.types.web.View]][source]
Return type:Callable[[Union[Type[View], Callable[[View, Request, Any, Any], Awaitable[Response]]]], Type[View]]
table_route(table: faust.types.tables.CollectionT, shard_param: str = None, *, query_param: str = None, match_info: str = None) → Callable[Callable[[faust.types.web.View, faust.types.web.Request, Any, Any], Awaitable[faust.types.web.Response]], Callable[[faust.types.web.View, faust.types.web.Request, Any, Any], Awaitable[faust.types.web.Response]]][source]
Return type:Callable[[Callable[[View, Request, Any, Any], Awaitable[Response]]], Callable[[View, Request, Any, Any], Awaitable[Response]]]
command(*options, base: Type[faust.types.app.AppCommand] = None, **kwargs) → Callable[Callable, Type[faust.types.app.AppCommand]][source]
Return type:Callable[[Callable], Type[AppCommand]]
is_leader() → bool[source]
Return type:bool
FlowControlQueue(maxsize: int = None, *, clear_on_resume: bool = False, loop: asyncio.events.AbstractEventLoop = None) → mode.utils.queues.ThrowableQueue[source]
Return type:ThrowableQueue
Worker(**kwargs) → faust.types.app.WorkerT[source]
Return type:WorkerT
on_webserver_init(web: faust.types.web.Web) → None[source]
Return type:None
on_rebalance_start() → None[source]
Return type:None
on_rebalance_end() → None[source]
Return type:None
conf
Return type:Settings
transport
Return type:TransportT
cache
Return type:CacheBackendT[]
producer
Return type:ProducerT[]
consumer
Return type:ConsumerT[]
tables[source]
topics[source]
monitor
Return type:Monitor
flow_control[source]
http_client
Return type:ClientSession
coroutine maybe_start_client(self) → None[source]
Return type:None
maybe_start_producer[source]
coroutine send(self, channel: Union[faust.types.channels.ChannelT, str], key: Union[bytes, faust.types.core.ModelT, Any, None] = None, value: Union[bytes, faust.types.core.ModelT, Any] = None, partition: int = None, key_serializer: Union[faust.types.codecs.CodecT, str, None] = None, value_serializer: Union[faust.types.codecs.CodecT, str, None] = None, callback: Callable[faust.types.tuples.FutureMessage, Union[None, Awaitable[None]]] = None) → Awaitable[faust.types.tuples.RecordMetadata][source]
Return type:Awaitable[RecordMetadata]
coroutine start_client(self) → None[source]
Return type:None
assignor
Return type:PartitionAssignorT
router
Return type:RouterT
serializers
Return type:RegistryT
web
Return type:Web