-
Notifications
You must be signed in to change notification settings - Fork 85
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
UpdatableStore #119
base: develop
Are you sure you want to change the base?
UpdatableStore #119
Conversation
neat! |
import com.twitter.util.Future | ||
|
||
trait UpdatableStore[K,V] extends Store[K,V] { | ||
def update(k : K)(fn : Option[V] => Option[V]) : Future[Unit] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it too restrictive to return Future[Option[V]]
which is the original input to the function? This way, the caller knows the value that was actually set into the store.
This does make buffering a pain, and I'm speculating on use cases, so ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was mostly just going by analogy with put, which also returns Future[Unit].
Buffering being a pain is a good point, and for me right now that outweighs any hypothetical benefit of returning it (I know that we'd want buffering with this, I'm not sure what we'd use the return value for).
The TODOs are so awesome! Hadn't seen that before. |
@avibryant, are you still interested in getting this bad dawg in? I think we can get it into the next release if so. |
I'm still interested but don't actively need it right now, so I'm in no rush. What do you think is the minimal TODO to make it worth merging? |
|
Sketching out an UpdatableStore trait as described in #113. Extends JMapStore and ConcurrentHashMapStore to be UpdateableStores, and adds a new RedisUpdatableStore that uses the TransactionalClient.
Totally untested so far.
Todo: