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

Make Paging stores easier #187

Open
johnynek opened this issue Nov 16, 2013 · 2 comments
Open

Make Paging stores easier #187

johnynek opened this issue Nov 16, 2013 · 2 comments

Comments

@johnynek
Copy link
Collaborator

trait PagingReadableStore[K, V] extends ReadableStore[K,Spool[V]]
// see: https://github.com/twitter/util/blob/master/util-core/src/main/scala/com/twitter/concurrent/Spool.scala

//combinator:
object PagingReadableStore {
  // C is some cursor type
  def from[K,V,C](readable: ReadableStore[(K,C), (V,C)])(nextPage: C => C): PagingReadableStore[K,V] // do the get, make an item for the Spool, on .tail, do the next call
}

This would be good for a store of Uid -> Followers on Twitter. Some have millions and we can't fit them into one response.

@rubanm
Copy link
Contributor

rubanm commented Nov 22, 2013

Sounds great. I think this will fit in really well with Redis list and set stores.
Can perhaps be done on MySQL as well using query LIMIT and some deduction for the cursor values.

@johnynek
Copy link
Collaborator Author

Yeah, the MySQL version would be great too. Indeed.

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

No branches or pull requests

2 participants