Skip to content

Commit

Permalink
Update BufferedReader.get_message docstring
Browse files Browse the repository at this point in the history
** Docstring now states that the `get_message` method utilizes a FIFO
ordering for grabbing messages from the queue.
  • Loading branch information
barbacbd committed Sep 15, 2022
1 parent b2b2a80 commit 56a39fa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions can/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,14 @@ 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
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, or else returns None (whichever is shorter). 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 Message if one exists, otherwise None.
"""
try:
if self.is_stopped:
Expand Down

0 comments on commit 56a39fa

Please sign in to comment.