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

Add a singleton metaclass for IncogniaAPI #72

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

aninhalbuquerque
Copy link
Contributor

This PR introduces the Singleton pattern to the IncogniaAPI class by defining the Singleton metaclass. The implementation ensures that all instances of the class share the same state, returning the same instance whenever the class is instantiated with the same parameters.

The main motivation for this change is to ensure that, when instantiating the IncogniaAPI multiple times with the same client_id and client_secret, the application uses the same authentication token instead of creating new tokens with each new instance.

@aninhalbuquerque aninhalbuquerque self-assigned this Sep 19, 2024
@aninhalbuquerque aninhalbuquerque force-pushed the singleton-metaclass branch 4 times, most recently from c9fcaeb to 27f24ec Compare September 19, 2024 16:47
@aninhalbuquerque aninhalbuquerque marked this pull request as ready for review September 19, 2024 18:41
@aninhalbuquerque aninhalbuquerque requested a review from a team as a code owner September 19, 2024 18:41
Copy link
Contributor

@b0rba b0rba left a comment

Choose a reason for hiding this comment

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

Excelente!

@aninhalbuquerque aninhalbuquerque merged commit 963507e into main Sep 20, 2024
4 checks passed
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.

3 participants