Skip to content

refactor: Connector classes with async dependencies #44

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

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

bryan-robitaille
Copy link
Contributor

Summary | Résumé

Testing over the weekend I was able to find a pattern to reliably create Class instances when dealing with async dependencies.

Redis Connector:

  • Add an additional property that holds the connect() promise and ensure all subsequent callers await the same promise before returning the initialized instance.

Database Connector:

  • Invert the condition and calls to satisfy biome.

@bryan-robitaille bryan-robitaille enabled auto-merge (squash) September 9, 2024 13:34
@bryan-robitaille bryan-robitaille merged commit 791c525 into main Sep 9, 2024
4 checks passed
@bryan-robitaille bryan-robitaille deleted the fix/redis_await_connection branch September 9, 2024 13:42
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