abstract
class Receiver
Queue to read stuff from.
acknowledge(self, message: platonic.queue.message.Message[~ValueType]) -> platonic.queue.message.Message[~ValueType]
Indicate that the given message is correctly processed.
Remove it from the queue.
acknowledge_many(self, messages: Iterable[platonic.queue.message.Message[~ValueType]]) -> None
Multiple messages are correctly processed.
Remove them from the queue.
acknowledgement(self, message: platonic.queue.message.Message[~ValueType])
Acknowledgement context manager.
Into this context manager, you can wrap any operation with a given Message. The context manager will automatically acknowledge the message when and if the code in its context completes successfully.
receive(self) -> platonic.queue.message.Message[~ValueType]
For the given
timeout
, wait for a new message from the queue.Return the message if received or raise a
ReceiveTimeout
error otherwise.The message is not deleted from the queue.