faust.serializers.schemas

class faust.serializers.schemas.Schema(*, key_type: Optional[Union[Type[ModelT], Type[bytes], Type[str]]] = None, value_type: Optional[Union[Type[ModelT], Type[bytes], Type[str]]] = None, key_serializer: Optional[Union[CodecT, str]] = None, value_serializer: Optional[Union[CodecT, str]] = None, allow_empty: Optional[bool] = None)[source]
update(*, key_type: Optional[Union[Type[ModelT], Type[bytes], Type[str]]] = None, value_type: Optional[Union[Type[ModelT], Type[bytes], Type[str]]] = None, key_serializer: Optional[Union[CodecT, str]] = None, value_serializer: Optional[Union[CodecT, str]] = None, allow_empty: Optional[bool] = None) None[source]
Return type:

None

loads_key(app: AppT, message: Message, *, loads: Optional[Callable] = None, serializer: Optional[Union[CodecT, str]] = None) KT[source]
Return type:

~KT

loads_value(app: AppT, message: Message, *, loads: Optional[Callable] = None, serializer: Optional[Union[CodecT, str]] = None) VT[source]
Return type:

~VT

dumps_key(app: AppT, key: Optional[Union[bytes, _ModelT, Any]], *, serializer: Optional[Union[CodecT, str]] = None, headers: Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]) Tuple[Any, Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]][source]
Return type:

_GenericAlias[Any, _UnionGenericAlias[_GenericAlias[_GenericAlias[str, bytes]], _GenericAlias[str, bytes], None]]

dumps_value(app: AppT, value: Union[bytes, _ModelT, Any], *, serializer: Optional[Union[CodecT, str]] = None, headers: Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]) Tuple[Any, Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]][source]
Return type:

_GenericAlias[Any, _UnionGenericAlias[_GenericAlias[_GenericAlias[str, bytes]], _GenericAlias[str, bytes], None]]

on_dumps_key_prepare_headers(key: Union[bytes, _ModelT, Any], headers: Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]) Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]][source]
Return type:

_UnionGenericAlias[_GenericAlias[_GenericAlias[str, bytes]], _GenericAlias[str, bytes], None]

on_dumps_value_prepare_headers(value: Union[bytes, _ModelT, Any], headers: Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]) Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]][source]
Return type:

_UnionGenericAlias[_GenericAlias[_GenericAlias[str, bytes]], _GenericAlias[str, bytes], None]

async decode(app: AppT, message: Message, *, propagate: bool = False) EventT[source]

Decode message from topic (compiled function not cached).

Return type:

EventT

compile(app: ~faust.types.app.AppT, *, on_key_decode_error: ~typing.Callable[[Exception, ~faust.types.tuples.Message], ~typing.Awaitable[None]] = <function _noop_decode_error>, on_value_decode_error: ~typing.Callable[[Exception, ~faust.types.tuples.Message], ~typing.Awaitable[None]] = <function _noop_decode_error>, default_propagate: bool = False) Callable[[...], Awaitable[EventT]][source]

Compile function used to decode event.

Return type:

_CallableGenericAlias[…, _GenericAlias[EventT]]