Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a persistent ampq connection when publishing #1142

Conversation

sillyfrog
Copy link

The current AsyncAioPikaManager implementation creates a new connection for every publish message, which is very expensive in the AMPQ protocol.

This addresses that, and (hopefully) the concerns raised in #692.

I'm not an advanced (nor intermediate) user of asyncio, so any feedback or advice is very welcome.

Thanks for the great library!

Fixes: #691

@sillyfrog
Copy link
Author

Some how I missed #935 - Closing

@sillyfrog
Copy link
Author

Re-opening as I think this will be more robust vs #935 because of the lock around the connection creation

@sillyfrog sillyfrog reopened this Mar 16, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #1142 (2e6d91f) into main (4b19c70) will not change coverage.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff            @@
##              main     #1142   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines         1717      1717           
  Branches       323       323           
=========================================
  Hits          1717      1717           
Impacted Files Coverage Δ
src/socketio/asyncio_aiopika_manager.py 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@miguelgrinberg
Copy link
Owner

Thanks. This wasn't as robust as I would have hoped, and also you've introduced some code duplication. I have now implemented this optimization along with some code cleanup and corresponding changes in the Kombu code. Please try out the main branch and let me know if there are any remaining issues.

@sillyfrog
Copy link
Author

Testing the async build now, and it's looking good. Thanks!

That commit will also close #935 .

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.

AsyncAioPikaManager connect
3 participants