From ed6bf9f3f5ab1f2bc43ea007a424519cb796e662 Mon Sep 17 00:00:00 2001 From: Brent Barbachem Date: Thu, 15 Sep 2022 10:06:54 -0400 Subject: [PATCH] Update BufferedReader.get_message docstring ** Docstring now states that the `get_message` method utilizes a FIFO ordering for grabbing messages from the queue. --- can/listener.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/can/listener.py b/can/listener.py index 12836a83c..6c9cdf0be 100644 --- a/can/listener.py +++ b/can/listener.py @@ -105,13 +105,13 @@ def on_message_received(self, msg: Message) -> None: def get_message(self, timeout: float = 0.5) -> Optional[Message]: """ - Attempts to retrieve the latest message received by the instance. If no message is - available it blocks for given timeout or until a message is received, or else - returns None (whichever is shorter). This method does not block after - :meth:`can.BufferedReader.stop` has been called. + Attempts to retrieve the message that has been in the queue for the longest amount + of time (FIFO). If no message is available, it blocks for given timeout or until a + message is received (whichever is shorter), or else returns None. This method does + not block after :meth:`can.BufferedReader.stop` has been called. :param timeout: The number of seconds to wait for a new message. - :return: the Message if there is one, or None if there is not. + :return: the received :class:`can.Message` or `None`, if the queue is empty. """ try: if self.is_stopped: