Skip to content

SubscriberProto

faststream.broker.subscriber.proto.SubscriberProto #

Bases: AsyncAPIProto, EndpointProto, WrapperProto[MsgType]

title_ instance-attribute #

title_

AsyncAPI object title.

description_ instance-attribute #

description_

AsyncAPI object description.

include_in_schema instance-attribute #

include_in_schema

Whetever to include operation in AsyncAPI schema or not.

name abstractmethod property #

name

Returns the name of the API operation.

description abstractmethod property #

description

Returns the description of the API operation.

calls instance-attribute #

calls

running instance-attribute #

running

call_name abstractmethod property #

call_name

add_prefix abstractmethod #

add_prefix(prefix)
Source code in faststream/broker/proto.py
@abstractmethod
def add_prefix(self, prefix: str) -> None: ...

schema abstractmethod #

schema()

Generate AsyncAPI schema.

Source code in faststream/asyncapi/proto.py
@abstractmethod
def schema(self) -> Dict[str, "Channel"]:
    """Generate AsyncAPI schema."""
    ...

add_middleware abstractmethod #

add_middleware(middleware)
Source code in faststream/broker/subscriber/proto.py
@abstractmethod
def add_middleware(self, middleware: "BrokerMiddleware[MsgType]") -> None: ...

get_log_context abstractmethod #

get_log_context(msg)
Source code in faststream/broker/subscriber/proto.py
@abstractmethod
def get_log_context(
    self,
    msg: Optional["StreamMessage[MsgType]"],
    /,
) -> Dict[str, str]: ...

setup abstractmethod #

setup(*, logger, graceful_timeout, broker_parser, broker_decoder, producer, extra_context, apply_types, is_validate, _get_dependant, _call_decorators)
Source code in faststream/broker/subscriber/proto.py
@override
@abstractmethod
def setup(  # type: ignore[override]
    self,
    *,
    logger: Optional["LoggerProto"],
    graceful_timeout: Optional[float],
    broker_parser: Optional["CustomCallable"],
    broker_decoder: Optional["CustomCallable"],
    producer: Optional["ProducerProto"],
    extra_context: "AnyDict",
    # FastDepends options
    apply_types: bool,
    is_validate: bool,
    _get_dependant: Optional[Callable[..., Any]],
    _call_decorators: Iterable["Decorator"],
) -> None: ...

start abstractmethod async #

start()
Source code in faststream/broker/subscriber/proto.py
@abstractmethod
async def start(self) -> None: ...

close abstractmethod async #

close()
Source code in faststream/broker/subscriber/proto.py
@abstractmethod
async def close(self) -> None: ...

consume abstractmethod async #

consume(msg)
Source code in faststream/broker/subscriber/proto.py
@abstractmethod
async def consume(self, msg: MsgType) -> Any: ...

process_message abstractmethod async #

process_message(msg)
Source code in faststream/broker/subscriber/proto.py
@abstractmethod
async def process_message(self, msg: MsgType) -> "Response": ...

get_one abstractmethod async #

get_one(*, timeout=5.0)
Source code in faststream/broker/subscriber/proto.py
@abstractmethod
async def get_one(
    self, *, timeout: float = 5.0
) -> "Optional[StreamMessage[MsgType]]": ...

add_call abstractmethod #

add_call(*, filter_, parser_, decoder_, middlewares_, dependencies_)
Source code in faststream/broker/subscriber/proto.py
@abstractmethod
def add_call(
    self,
    *,
    filter_: "Filter[Any]",
    parser_: "CustomCallable",
    decoder_: "CustomCallable",
    middlewares_: Iterable["SubscriberMiddleware[Any]"],
    dependencies_: Iterable["Depends"],
) -> Self: ...