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.

rebalancing_count = 0
unassigned = False
in_worker = False
on_configured(sender: T_contra = None, *args, **kwargs) → None = <SyncSignal: AppT.on_configured>
on_before_configured(sender: T_contra = None, *args, **kwargs) → None = <SyncSignal: AppT.on_before_configured>
on_after_configured(sender: T_contra = None, *args, **kwargs) → None = <SyncSignal: AppT.on_after_configured>
on_partitions_assigned(sender: T_contra = None, *args, **kwargs) → None = <Signal: AppT.on_partitions_assigned>
on_partitions_revoked(sender: T_contra = None, *args, **kwargs) → None = <Signal: AppT.on_partitions_revoked>
on_rebalance_complete(sender: T_contra = None, *args, **kwargs) → None = <Signal: AppT.on_rebalance_complete>
on_before_shutdown(sender: T_contra = None, *args, **kwargs) → None = <Signal: AppT.on_before_shutdown>
on_worker_init(sender: T_contra = None, *args, **kwargs) → None = <SyncSignal: AppT.on_worker_init>
config_from_object(obj: Any, *, silent: bool = False, force: bool = False) → None[source]
Return type:None
finalize() → None[source]
Return type:None
main() → NoReturn[source]
Return type:_NoReturn
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, use_reply_headers: bool = False, **kwargs) → Callable[Callable[faust.types.streams.StreamT, Union[Coroutine[[Any, Any], None], Awaitable[None], AsyncIterable]], faust.types.agents.AgentT][source]
Return type:Callable[[Callable[[StreamT[+T_co]], Union[Coroutine[Any, Any, None], Awaitable[None], AsyncIterable[+T_co]]]], AgentT[]]
task(fun: Union[Callable[AppT, Awaitable], Callable[Awaitable]]) → Callable[source]
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'>, cors_options: Mapping[str, faust.types.web.ResourceOptions] = None, name: str = None) → Callable[Union[Type[faust.types.web.View], Callable[[faust.types.web.View, faust.types.web.Request], Union[Coroutine[[Any, Any], faust.types.web.Response], Awaitable[faust.types.web.Response]]], Callable[[faust.types.web.View, faust.types.web.Request, Any, Any], Union[Coroutine[[Any, Any], faust.types.web.Response], Awaitable[faust.types.web.Response]]]], Type[faust.types.web.View]][source]
Return type:Callable[[Union[Type[View], Callable[[View, Request], Union[Coroutine[Any, Any, Response], Awaitable[Response]]], Callable[[View, Request, Any, Any], Union[Coroutine[Any, Any, Response], Awaitable[Response]]]]], Type[View]]
table_route(table: faust.types.tables.CollectionT, shard_param: str = None, *, query_param: str = None, match_info: str = None) → Callable[Union[Callable[[faust.types.web.View, faust.types.web.Request], Union[Coroutine[[Any, Any], faust.types.web.Response], Awaitable[faust.types.web.Response]]], Callable[[faust.types.web.View, faust.types.web.Request, Any, Any], Union[Coroutine[[Any, Any], faust.types.web.Response], Awaitable[faust.types.web.Response]]]], Union[Callable[[faust.types.web.View, faust.types.web.Request], Union[Coroutine[[Any, Any], faust.types.web.Response], Awaitable[faust.types.web.Response]]], Callable[[faust.types.web.View, faust.types.web.Request, Any, Any], Union[Coroutine[[Any, Any], faust.types.web.Response], Awaitable[faust.types.web.Response]]]]][source]
Return type:Callable[[Union[Callable[[View, Request], Union[Coroutine[Any, Any, Response], Awaitable[Response]]], Callable[[View, Request, Any, Any], Union[Coroutine[Any, Any, Response], Awaitable[Response]]]]], Union[Callable[[View, Request], Union[Coroutine[Any, Any, Response], Awaitable[Response]]], Callable[[View, Request, Any, Any], Union[Coroutine[Any, Any, Response], 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._Worker[source]
Return type:_Worker
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
assignor
Return type:PartitionAssignorT
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, timestamp: float = None, headers: Union[List[Tuple[str, bytes]], Mapping[str, bytes]] = 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
router
Return type:RouterT
serializers
Return type:RegistryT
web
Return type:Web
in_transaction
Return type:bool