PullSub
faststream.nats.PullSub #
PullSub(
batch_size: int = 1,
timeout: float | None = 5.0,
batch: Literal[False] = False,
)
PullSub(
batch_size: int = 1,
timeout: float | None = 5.0,
batch: Literal[True] = ...,
)
PullSub(
batch_size: int = 1,
timeout: float | None = 5.0,
batch: bool = ...,
)
PullSub(
batch_size: int = 1,
timeout: float | None = 5.0,
batch: bool = False,
)
Bases: Generic[BatchT_co]
A class to represent a NATS pull subscription.
| PARAMETER | DESCRIPTION |
|---|---|
batch_size | Target batch size with TYPE: |
timeout ( | obj:
|
batch | Whether to propagate consuming batch as iterable object to your handler (default is TYPE: |
Source code in faststream/nats/schemas/pull_sub.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
validate classmethod #
validate(value: Literal[True]) -> PullSub
validate(value: Literal[False]) -> None
Source code in faststream/nats/schemas/pull_sub.py
85 86 87 88 89 90 91 | |