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 Oct 3, 2022
1 parent b2b2a80 commit ed6bf9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions can/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ed6bf9f

Please sign in to comment.