NatsRouter
faststream.nats.shared.router.NatsRouter #
Bases: BrokerRouter[str, Msg]
A class to represent a NATS router.
Initialize the NATS router.
PARAMETER | DESCRIPTION |
---|---|
prefix | The prefix. TYPE: |
handlers | The handlers. |
**kwargs | The keyword arguments. TYPE: |
Source code in faststream/nats/shared/router.py
include_router #
include_router(
router: BrokerRouter[PublisherKeyType, MsgType]
) -> None
Includes a router in the current object.
PARAMETER | DESCRIPTION |
---|---|
router | The router to be included. TYPE: |
RETURNS | DESCRIPTION |
---|---|
None | None |
Source code in faststream/broker/router.py
include_routers #
include_routers(
*routers: BrokerRouter[PublisherKeyType, MsgType]
) -> None
Includes routers in the object.
PARAMETER | DESCRIPTION |
---|---|
*routers | Variable length argument list of routers to include. TYPE: |
RETURNS | DESCRIPTION |
---|---|
None | None |
Source code in faststream/broker/router.py
publisher abstractmethod
#
publisher(
subj: str, *args: Any, **kwargs: Any
) -> BasePublisher[MsgType]
Publishes a message.
PARAMETER | DESCRIPTION |
---|---|
subj | Subject of the message TYPE: |
*args | Additional arguments TYPE: |
**kwargs | Additional keyword arguments TYPE: |
RETURNS | DESCRIPTION |
---|---|
BasePublisher[MsgType] | The published message |
RAISES | DESCRIPTION |
---|---|
NotImplementedError | If the method is not implemented |