{"action":"created","issue":{"url":"https://api.github.com/repos/shayhatsor/zookeeper/issues/33","repository_url":"https://api.github.com/repos/shayhatsor/zookeeper","labels_url":"https://api.github.com/repos/shayhatsor/zookeeper/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/shayhatsor/zookeeper/issues/33/comments","events_url":"https://api.github.com/repos/shayhatsor/zookeeper/issues/33/events","html_url":"https://github.com/shayhatsor/zookeeper/issues/33","id":383882689,"node_id":"MDU6SXNzdWUzODM4ODI2ODk=","number":33,"title":"Watch not triggered","user":{"login":"alexandrutatagit","id":45294552,"node_id":"MDQ6VXNlcjQ1Mjk0NTUy","avatar_url":"https://avatars1.githubusercontent.com/u/45294552?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandrutatagit","html_url":"https://github.com/alexandrutatagit","followers_url":"https://api.github.com/users/alexandrutatagit/followers","following_url":"https://api.github.com/users/alexandrutatagit/following{/other_user}","gists_url":"https://api.github.com/users/alexandrutatagit/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrutatagit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrutatagit/subscriptions","organizations_url":"https://api.github.com/users/alexandrutatagit/orgs","repos_url":"https://api.github.com/users/alexandrutatagit/repos","events_url":"https://api.github.com/users/alexandrutatagit/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrutatagit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-23T16:38:37Z","updated_at":"2018-12-11T19:35:45Z","closed_at":"2018-12-11T19:35:45Z","author_association":"NONE","body":"Hi!\r\n\r\nI have a very simple example, I am reading a node from ZK, and then I want to see that I get notified when updates are made to that node. However, only my first change in the note gets notified, the rest not. Also, I am unsure what I must return in the process method, when extending the Watch abstract class.\r\nThank you,\r\nAlex\r\n\r\n```\r\nclass Program\r\n{\r\n\tasync static Task Main(string[] args)\r\n\t{\r\n\t\tWatcher watcher = new MyWatcher();\r\n\t\tZooKeeper zk = new ZooKeeper(\"kafka1:2181,kafka2:2181,kafka3:2181\", 30000, watcher);\r\n\t\tDataResult stat = await zk.getDataAsync(\"/alex/test\", watcher);\r\n\t\tstring json = Encoding.UTF8.GetString(stat.Data);\r\n\t\twhile (true)\r\n\t\t{\r\n\t\t\tawait Task.Delay(1000);\r\n\t\t}\r\n\t}\r\n}\r\n\r\npublic class MyWatcher : Watcher\r\n{\r\n\tpublic override Task process(WatchedEvent @event)\r\n\t{\r\n\t\tConsole.WriteLine(@event.ToString());\r\n\t\treturn Task.Delay(0);\r\n\t}\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/shayhatsor/zookeeper/issues/comments/446332861","html_url":"https://github.com/shayhatsor/zookeeper/issues/33#issuecomment-446332861","issue_url":"https://api.github.com/repos/shayhatsor/zookeeper/issues/33","id":446332861,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjMzMjg2MQ==","user":{"login":"shayhatsor","id":12084632,"node_id":"MDQ6VXNlcjEyMDg0NjMy","avatar_url":"https://avatars0.githubusercontent.com/u/12084632?v=4","gravatar_id":"","url":"https://api.github.com/users/shayhatsor","html_url":"https://github.com/shayhatsor","followers_url":"https://api.github.com/users/shayhatsor/followers","following_url":"https://api.github.com/users/shayhatsor/following{/other_user}","gists_url":"https://api.github.com/users/shayhatsor/gists{/gist_id}","starred_url":"https://api.github.com/users/shayhatsor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shayhatsor/subscriptions","organizations_url":"https://api.github.com/users/shayhatsor/orgs","repos_url":"https://api.github.com/users/shayhatsor/repos","events_url":"https://api.github.com/users/shayhatsor/events{/privacy}","received_events_url":"https://api.github.com/users/shayhatsor/received_events","type":"User","site_admin":false},"created_at":"2018-12-11T19:35:45Z","updated_at":"2018-12-11T19:35:45Z","author_association":"OWNER","body":"1) There is no way to get notified about every change, it is explained in detail in [the link i've provided earlier](https://zookeeper.apache.org/doc/r3.4.13/zookeeperProgrammers.html#ch_zkWatches). An attempt to handle changes is explained [here](https://github.com/apache/zookeeper/blob/master/zookeeper-docs/src/main/resources/markdown/javaExample.md).\r\nAbout documentation, for any zookeeper related question you can always go to the [official site](https://zookeeper.apache.org). My C# port of the Apache Zookeeper Java Client provides the same API (in async flavour). Essentially, all Java Client code examples you find are applicable to the C# client.\r\n2) The reason that the process method returns a Task is to allow async/await constructs usage. You can return Task\\<T\\>, but it wouldn't make sense, since the return value is thrown away."}}
{"actor":{"display_login":"shayhatsor"}}