Skip to content

Add a singleton metaclass for IncogniaAPI#72

Merged
aninhalbuquerque merged 2 commits intomainfrom
singleton-metaclass
Sep 20, 2024
Merged

Add a singleton metaclass for IncogniaAPI#72
aninhalbuquerque merged 2 commits intomainfrom
singleton-metaclass

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
Signed-off-by: Almir Cunha <91955658+almirmcunhajr@users.noreply.github.com>
@aninhalbuquerque aninhalbuquerque marked this pull request as ready for review September 19, 2024 18:41
@aninhalbuquerque aninhalbuquerque requested a review from a team 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
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