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

Support Local Mappings Provider #11

Merged
merged 2 commits into from
Jul 31, 2024
Merged

Support Local Mappings Provider #11

merged 2 commits into from
Jul 31, 2024

Conversation

JAVGan
Copy link
Collaborator

@JAVGan JAVGan commented Jul 30, 2024

This PR introduces the concept of providers which works as a way to store and retrieve QueryResponse objects from a local environment instead of having to request it to the server.

It also implements the first provider named InMemoryMapProvider which aims to provide an "offline" way to store existing QueryResponse objects in memory and use them to provide mappings. Then, whenever an object exists "offline" (in memory) it will be returned instead of having to request it from StArMap server.

Finally, it changes the StarmapClient by adding a new constructor argument named provider, which when set with a StArMapProvider will use it to query image image first and only proceed to query the server whenever the mapping is not found in the local provider.

Refers to SPSTRAT-325

This commit introduces the concept of `providers` which works as a way
to store and retrieve `QueryResponse` objects from a local environment
instead of having to request it to the server.

It also implements the first provider named `InMemoryMapProvider` which
aims to provide an "offline" way to store existing `QueryResponse`
objects in memory and use them to provide mappings. Then, whenever an
object exists "offline" (in memory) it will be returned instead of
having to request it from StArMap server.

Refers to SPSTRAT-325
This commit changes the `StarmapClient` by adding a new constructor
argument named `provider`, which when set with a `StArMapProvider` will
use it to query image image first and only proceed to query the server
whenever the mapping is not found in the local provider.

Refers to SPSTRAT-325
Copy link
Collaborator

@jajreidy jajreidy left a comment

Choose a reason for hiding this comment

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

LGTM

@JAVGan JAVGan merged commit e3a3a13 into main Jul 31, 2024
18 checks passed
@JAVGan JAVGan deleted the offline_mappings branch July 31, 2024 17:11
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