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

Implement named fetchers #87

Closed
wants to merge 1 commit into from
Closed

Conversation

apoi
Copy link
Collaborator

@apoi apoi commented Nov 2, 2015

By default the used fetcher is chosen by content URI. We may however want to choose a specific fetcher in case of multiple fetchers implementing the same content URI. This patch adds fetcher identifiers that can be used to request a specific fetcher.

By default the used fetcher is chosen by content uri. We may however want
to choose a specific fetcher in case of multiple fetchers implementing the
same content uri. This patch adds fetcher identifiers that can be used to
request a specific fetcher.
@tehmou
Copy link
Collaborator

tehmou commented Nov 4, 2015

Why would you want to use a different fetcher for same URI? It would seem to violate the principle that one URI comes from one source of truth.. or am I missing something?

@apoi
Copy link
Collaborator Author

apoi commented Nov 4, 2015

In my use case there are multiple API endpoints for the same kind of content. E.g. a search for Items at /api/search?q=term, top list of Items at /api/top50, and currently trending Items at /api/trending. They all return the same kind of Item lists, so I want to use same stores for them.

@tehmou
Copy link
Collaborator

tehmou commented Nov 8, 2015

Hmm I see. Do you have a code example of how to use these?

Ideally I guess fetchers should operate independently of the URI, since we do not always know or care what kind of data they return - it could be a combination of many. URI structure and query URL structure do not need to match. However, it is probably useful to have one "standard" place where to get data for a given URI regardless of where it originally came from the first time.

@apoi
Copy link
Collaborator Author

apoi commented Nov 8, 2015

@apoi
Copy link
Collaborator Author

apoi commented Nov 8, 2015

Closing this, a bit different approach at #88.

@apoi apoi closed this Nov 8, 2015
@apoi apoi deleted the feature/named-fetchers branch November 8, 2015 22:10
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.

None yet

2 participants