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

Merged
merged 6 commits into from
Jun 12, 2024

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
Member

@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
Member

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
Member

@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
Member

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

@gaby
Copy link

gaby commented Jun 11, 2024

@Lancetnik Now that #1383 is merged, any updates on this one?

@Lancetnik
Copy link
Member

We can merge it any moment, but it will be released is a part of big RMQ update. Now I am preparing code-base and collect my forces to start working on this change

@Lancetnik Lancetnik changed the base branch from main to feat/rmq-update June 12, 2024 09:12
@Lancetnik Lancetnik merged commit d12abef into airtai:feat/rmq-update Jun 12, 2024
25 of 27 checks passed
@Lancetnik
Copy link
Member

I start to work on RMQ changes in (#1510) scope, this branch will be base of it, thank you!

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
Archived in project
Development

Successfully merging this pull request may close these issues.

Feature: use aio_pika.Pool to connect RMQ
3 participants