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

975 use aio pika pool #1401

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Focadecombate
Copy link

Description

Use aio-pika pools for handling rabbit connections and channels

Fixes #975

Type of change

Please delete options that are not relevant.

  • Documentation (typos, code examples, or any documentation updates)
  • Bug fix (a non-breaking change that resolves an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would disrupt existing functionality)
  • This change requires a documentation update

Checklist

  • My code adheres to the style guidelines of this project (scripts/lint.sh shows no errors)
  • I have conducted a self-review of my own code
  • I have made the necessary changes to the documentation
  • My changes do not generate any new warnings
  • I have added tests to validate the effectiveness of my fix or the functionality of my new feature
  • Both new and existing unit tests pass successfully on my local environment by running scripts/test-cov.sh
  • I have ensured that static analysis tests are passing by running scripts/static-anaylysis.sh
  • I have included code examples to illustrate the modifications

Copy link
Collaborator

@Lancetnik Lancetnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! Looks good, but I will be able to look closer after May weekends in Russia. Also, can you please set default max_channels number to 1? I don't want to change default behavior for our users.

@Lancetnik Lancetnik added the enhancement New feature or request label Apr 26, 2024
@Focadecombate
Copy link
Author

Sure, will do!

@@ -346,23 +357,34 @@ async def _connect( # type: ignore[override]
*,
timeout: "TimeoutType",
ssl_context: Optional["SSLContext"],
max_connection_pool_size: int = 1,
max_channel_pool_size: int = 1,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you plase add these options with Annotated[..., Doc()] declaration to RabbitBroker.__init__ and FastAPI integration router init method too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, it's done!

Copy link
Collaborator

@Lancetnik Lancetnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, just add type annotations in broker and FastAPI router init methods and we'll merge it

@Lancetnik
Copy link
Collaborator

Thank you for the work! I am planning a some new RabbitMQ features soon. So, I'll merge it after #1383 as a first step of RMQ changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Feature: use aio_pika.Pool to connect RMQ
2 participants