eclipse-paho / eclipse-paho/paho.mqtt.python

Feature req/ suggestion. Public API for client._out_messages.clear()

Open Beginner friendly
#935 0 comments 0 reactions 0 assignees View on GitHub
Status: Available
Dominant language
Python
Stars
2.4k
Forks
742
Avg merge
12d 48m
Merged PRs (30d)
1

Description

Minimal example:
```
def clear_messages(self) -> None:
with client._out_message_mutex:
client._out_messages.clear()
```

Power users can encounter situations in which delivery of customised QoS 1 or QoS 2 messages, e.g. using topic aliases fails. Without any way to clear undelivered messages and try again, these can cause the server to kick the client. If the user has called client.loop_forever, this creates an unnecessary connection cycle, that they must currently resort to calling Paho's private methods to resolve.

This is the simplest solution suggested by Josh last year in issue #893

Contributor guide

Open the contributing guide

Research direction

Start at the client implementation containing _out_messages and _out_message_mutex, and trace how queued QoS 1 and QoS 2 messages are managed. Add the supported public clearing entry point described in the issue, then verify that undelivered messages can be cleared without requiring private methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.