Skip to content

Conversation

@bitcapybara
Copy link

@bitcapybara bitcapybara commented Jul 12, 2025

Closes #975

Breaking change

By removing the unused request_tx field from EventLoop, EventLoop can achieve graceful shutdown by triggering a RequestsDone error when all AsyncClient(Sender) instances have exited.

This code change alters the return value of the EventLoop::new method, breaking backward compatibility with the existing API.

@bitcapybara bitcapybara changed the title fix(rumqttc): remove request_tx from EventLoop to allow EventLoop to gracefully exit fix(rumqttc): remove request_tx from EventLoop to allow gracefully exit Jul 12, 2025
@jarhodes314
Copy link

We have also struggled with gracefully shutting down rumqttc, and I would really like to see this issue solved as the solution we've been forced to employ is quite convoluted.

For a truly graceful shutdown, the event loop should send a disconnect packet rather than just dropping the connection, which I believe is what this current solution does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventLoop cannot gracefully exit because it holds a request_tx

2 participants