Skip to content

Commit

Permalink
docs: Update references to queue_type and max_queued_incoming_messages
Browse files Browse the repository at this point in the history
  • Loading branch information
empicano committed Feb 18, 2024
1 parent 13b44fb commit cabc9b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ asyncio.run(main())

This project is licensed under the [BSD 3-clause License](https://opensource.org/licenses/BSD-3-Clause).

Note that the underlying paho-mqtt library is dual-licensed. One of the licenses is the so-called [Eclipse Distribution License v1.0](https://www.eclipse.org/org/documents/edl-v10.php). It is almost word-for-word identical to the BSD 3-clause License. The only differences are:
Note that the underlying paho-mqtt library is dual-licensed. One of the licenses is the [Eclipse Distribution License v1.0](https://www.eclipse.org/org/documents/edl-v10.php), which is almost identical to the BSD 3-clause License. The differences are:

- One use of "COPYRIGHT OWNER" (EDL) instead of "COPYRIGHT HOLDER" (BSD)
- One use of "Eclipse Foundation, Inc." (EDL) instead of "copyright holder" (BSD)
Expand Down
6 changes: 3 additions & 3 deletions docs/subscribing-to-a-topic.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ For details on the `+` and `#` wildcards and what topics they match, see the [OA

Messages are queued internally and returned sequentially from `Client.messages`.

The default queue is `asyncio.Queue` which returns messages on a FIFO ("first in first out") basis. You can pass [other types of asyncio queues](https://docs.python.org/3/library/asyncio-queue.html) as `queue_class` to the `Client` to modify the order in which messages are returned, e.g. `asyncio.LifoQueue`.
The default queue is `asyncio.Queue` which returns messages on a FIFO ("first in first out") basis. You can pass [other types of asyncio queues](https://docs.python.org/3/library/asyncio-queue.html) as `queue_type` to the `Client` to modify the order in which messages are returned, e.g. `asyncio.LifoQueue`.

You can subclass `asyncio.PriorityQueue` to queue based on priority. Messages are returned ascendingly by their priority values. In the case of ties, messages with lower message identifiers are returned first.

Expand All @@ -86,7 +86,7 @@ class CustomPriorityQueue(asyncio.PriorityQueue):

async def main():
async with aiomqtt.Client(
"test.mosquitto.org", queue_class=CustomPriorityQueue
"test.mosquitto.org", queue_type=CustomPriorityQueue
) as client:
await client.subscribe("temperature/#")
await client.subscribe("humidity/#")
Expand All @@ -98,7 +98,7 @@ asyncio.run(main())
```

```{tip}
By default, the size of the queue is unlimited. You can set a limit by passing the `queue_maxsize` parameter to `Client.messages()`.
By default, the size of the queue is unlimited. You can set a limit through the client's `max_queued_incoming_messages` argument.
```

## Processing concurrently
Expand Down

0 comments on commit cabc9b0

Please sign in to comment.