-
Notifications
You must be signed in to change notification settings - Fork 8
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 watch #9
Comments
I did an initial implementation of this. But it seems the watch callback is executed only once for the change since I was thinking about pub/sub like use cases. |
Hi @tirkarthi : While I appreciate the value of providing a callback based API in the library, I am not sure what the shape of this API should be. In the meantime, would be be open to submitting a PR which implements a simple wrapper over the |
Yes, this is why I want to understand the possibilities before putting helper fns in the library. |
Thanks @vedang for the review. I proposed it for API parity and initially it seemed to be a useful addition. But once I implemented it I couldn't fit a good use case for it. Maybe I am missing something about the use case since I am still a beginner with respect to FoundationDB. Unfortunately, I will not be able to pick this up due to lack of time. I am closing this in favour of #11 Thanks |
Is your feature request related to a problem? Please describe.
Implement watch API that can be used to track the changes made to a key.
Describe the solution you'd like
Watch API is available in the Java client that can be used to track the changes made to the key with callbacks.
Additional context
I have tried an initial implementation of
watch
that works as below :Implementation
https://github.com/tirkarthi/clj-foundationdb/blob/37f39adca4069070fab2a4630b76b4fab22ead93/src/clj_foundationdb/core.clj#L176
Basic test with callback and future
https://github.com/tirkarthi/clj-foundationdb/blob/37f39adca4069070fab2a4630b76b4fab22ead93/test/clj_foundationdb/core_test.clj#L305
Java docs reference
https://apple.github.io/foundationdb/javadoc/com/apple/foundationdb/Transaction.html#watch-byte:A-
Python docs reference with example
https://apple.github.io/foundationdb/developer-guide.html#watches
Feedback welcome.
The text was updated successfully, but these errors were encountered: