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

about add_watch_callback #2348

Open
316953425 opened this issue Dec 13, 2023 · 1 comment
Open

about add_watch_callback #2348

316953425 opened this issue Dec 13, 2023 · 1 comment

Comments

@316953425
Copy link

316953425 commented Dec 13, 2023

Use the add_watch_callback function to listen key events. If the key is deleted, how to get the value before the key deleted in the callback function of add_watch_callback.
For example:
key:/hello value:1234
delete /hello
Using add_watch_callback how to get 1234 when delete event occurs

Looking forward to your answer, thank you very much

@itsparth
Copy link

You can pass prev_kv=True as a kwarg, see https://etcd.io/docs/v3.2/learning/api/#watch-streams
E.g. etcd.watch("/key", prev_kv=True)

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