Skip to content

Commit 23b6b19

Browse files
authored
Update BufferedReader.get_message docstring (#1397)
** Docstring now states that the `get_message` method utilizes a FIFO ordering for grabbing messages from the queue.
1 parent b2b2a80 commit 23b6b19

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

can/listener.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ def on_message_received(self, msg: Message) -> None:
105105

106106
def get_message(self, timeout: float = 0.5) -> Optional[Message]:
107107
"""
108-
Attempts to retrieve the latest message received by the instance. If no message is
109-
available it blocks for given timeout or until a message is received, or else
110-
returns None (whichever is shorter). This method does not block after
111-
:meth:`can.BufferedReader.stop` has been called.
108+
Attempts to retrieve the message that has been in the queue for the longest amount
109+
of time (FIFO). If no message is available, it blocks for given timeout or until a
110+
message is received (whichever is shorter), or else returns None. This method does
111+
not block after :meth:`can.BufferedReader.stop` has been called.
112112
113113
:param timeout: The number of seconds to wait for a new message.
114-
:return: the Message if there is one, or None if there is not.
114+
:return: the received :class:`can.Message` or `None`, if the queue is empty.
115115
"""
116116
try:
117117
if self.is_stopped:

0 commit comments

Comments
 (0)