Skip to content

feat: use async on session service #343

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

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

Conversation

thiagosalvatore
Copy link

@thiagosalvatore thiagosalvatore commented Apr 22, 2025

This PR addresses the issue #347 .

Description

The current implementation of BaseSessionService is not async. It has a ton of I/O operations that would block the main event loop. Instead, we should leverage async to run database operations on the session.

This PR updates the BaseSessionService as well as its implementations to use async, preventing the event loop from being blocked and allowing the usage of other database implementations like motor for MongoDB.

This PR does not updates the DatabaseSessionService to use the async version of sqlalchemy.

Tests

  1. All the unit tests are working
  2. I am deploying a custom implementation of BaseSessionService and it is working just fine.

BREAKING CHANGE: current implementations of `BaseSessionService` should use async now.
fix tests with missing await statement
@thiagosalvatore thiagosalvatore changed the title Use async on session service feat: use async on session service Apr 22, 2025
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.

2 participants