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 alternatives and acknowledgements #43

Merged
merged 1 commit into from
May 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions docs/src/tut/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ def println(msg: String): Unit = {
}
```

## Alternatives

There are other libraries in Scala that implement the same optimizations as Fetch does and have different design decisions. If Fetch is not suitable for you these alternatives may be a better fit:

- [Clump](http://getclump.io/) it's been around for a long time and is used in production systems at SoundCloud and LinkedIn. You can use it with Scala's or Twitter's Futures.
- [Resolvable](https://github.com/resolvable/resolvable) can be used with Scala Futures.

If something is missing in Fetch that stops you from using it we'd appreciate if you [open an issue in our repository](https://github.com/47deg/fetch/issues).

# Usage

In order to tell Fetch how to retrieve data, we must implement the `DataSource` typeclass.
Expand Down Expand Up @@ -170,7 +179,7 @@ val result: (User, User) = fetchTwoUsers.runA[Eval].value

### Batching

If we combine two independent requests to the same data source, Fetch will
If we combine two independent requests to the same data source, Fetch will
automatically batch them together into a single request. Applicative operations like the product of two fetches
help us tell the library that those fetches are independent, and thus can be batched if they use the same data source:

Expand Down Expand Up @@ -446,7 +455,7 @@ data sources.
```tut:book
val populatedCache = fetchManyUsers.runE[Eval].value.cache

val result: List[User] = fetchManyUsers.runA[Eval](populatedCache).value
val result: List[User] = fetchManyUsers.runA[Eval](populatedCache).value
```

## Implementing a custom cache
Expand Down Expand Up @@ -737,3 +746,12 @@ val result: String = fetchFriends.runA[Eval].value
- [Code](https://github.com/47deg/fetch) on GitHub.
- [Documentation site](http://47deg.github.io/fetch/)
- [Fetch: Simple & Efficient data access](https://www.youtube.com/watch?v=45fcKYFb0EU) talk at [Typelevel Summit in Oslo](http://typelevel.org/event/2016-05-summit-oslo/)

# Acknowledgements

Fetch stands on the shoulders of giants:

- [Haxl](https://github.com/facebook/haxl) is Facebook's implementation (Haskell) of the [original paper Fetch is based on](http://community.haskell.org/~simonmar/papers/haxl-icfp14.pdf).
- [Clump](http://getclump.io) has inspired the signature of the `DataSource#fetch` method.
- [Stitch](https://engineering.twitter.com/university/videos/introducing-stitch) is an in-house Twitter library that is not open source but has inspired Fetch's high-level API.