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

Wrong stopCh type in Watch/WatchTree #58

Closed
vcastellm opened this issue Sep 17, 2015 · 1 comment
Closed

Wrong stopCh type in Watch/WatchTree #58

vcastellm opened this issue Sep 17, 2015 · 1 comment

Comments

@vcastellm
Copy link

As defined in the interface https://github.com/docker/libkv/blob/master/store/store.go#L64-L69 the stopCh won't work as intended.

I see from the tests that it's not used at all and I guess you're not using it anywhere else.
https://github.com/docker/libkv/blob/master/testutils/utils.go#L102-L103

This poppedup to me when trying to use a watch in my project.

At least in etcd the stopCh must be a send-only type ch. for the purpose of stopping the watch. Also in libkv it's the intended usage: https://github.com/docker/libkv/blob/master/store/etcd/etcd.go#L227

I can take care of this refactor. Note that may result in breaking API changes.

@vcastellm
Copy link
Author

The test confused me sorry, declaring the channel as bidirectional solves the issue I was having.

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

1 participant