BaseWatcher
faststream.broker.push_back_watcher.BaseWatcher #
Bases: ABC
A base class for a watcher.
| PARAMETER | DESCRIPTION |
|---|---|
max_tries | maximum number of tries allowed (default=0) DEFAULT: |
logger | logger object (optional) DEFAULT: |
| METHOD | DESCRIPTION |
|---|---|
add | add a message to the watcher |
is_max | check if the maximum number of tries has been reached for a message |
remove | remove a message from the watcher |
Initialize the class.
| PARAMETER | DESCRIPTION |
|---|---|
max_tries | Maximum number of tries allowed TYPE: |
logger | Optional logger object |
| RAISES | DESCRIPTION |
|---|---|
NotImplementedError | If the method is not implemented in the subclass. |
Source code in faststream/broker/push_back_watcher.py
add abstractmethod #
Add a message.
| PARAMETER | DESCRIPTION |
|---|---|
message_id | ID of the message to be added TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
None | None |
| RAISES | DESCRIPTION |
|---|---|
NotImplementedError | If the method is not implemented |
Source code in faststream/broker/push_back_watcher.py
is_max abstractmethod #
Check if the given message ID is the maximum.
| PARAMETER | DESCRIPTION |
|---|---|
message_id | The ID of the message to check. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
bool | True if the given message ID is the maximum, False otherwise. |
| RAISES | DESCRIPTION |
|---|---|
NotImplementedError | This method is meant to be overridden by subclasses. |
Source code in faststream/broker/push_back_watcher.py
remove abstractmethod #
Remove a message.
| PARAMETER | DESCRIPTION |
|---|---|
message_id | ID of the message to be removed TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
None | None |
| RAISES | DESCRIPTION |
|---|---|
NotImplementedError | If the method is not implemented |