{"action":"created","issue":{"url":"https://api.github.com/repos/loganasherjones/yapconf/issues/36","repository_url":"https://api.github.com/repos/loganasherjones/yapconf","labels_url":"https://api.github.com/repos/loganasherjones/yapconf/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/loganasherjones/yapconf/issues/36/comments","events_url":"https://api.github.com/repos/loganasherjones/yapconf/issues/36/events","html_url":"https://github.com/loganasherjones/yapconf/issues/36","id":309571291,"number":36,"title":"Yapconf Watcher","user":{"login":"loganasherjones","id":3633332,"avatar_url":"https://avatars0.githubusercontent.com/u/3633332?v=4","gravatar_id":"","url":"https://api.github.com/users/loganasherjones","html_url":"https://github.com/loganasherjones","followers_url":"https://api.github.com/users/loganasherjones/followers","following_url":"https://api.github.com/users/loganasherjones/following{/other_user}","gists_url":"https://api.github.com/users/loganasherjones/gists{/gist_id}","starred_url":"https://api.github.com/users/loganasherjones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loganasherjones/subscriptions","organizations_url":"https://api.github.com/users/loganasherjones/orgs","repos_url":"https://api.github.com/users/loganasherjones/repos","events_url":"https://api.github.com/users/loganasherjones/events{/privacy}","received_events_url":"https://api.github.com/users/loganasherjones/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/loganasherjones/yapconf/milestones/1","html_url":"https://github.com/loganasherjones/yapconf/milestone/1","labels_url":"https://api.github.com/repos/loganasherjones/yapconf/milestones/1/labels","id":3363207,"number":1,"title":"0.3.0","description":"","creator":{"login":"loganasherjones","id":3633332,"avatar_url":"https://avatars0.githubusercontent.com/u/3633332?v=4","gravatar_id":"","url":"https://api.github.com/users/loganasherjones","html_url":"https://github.com/loganasherjones","followers_url":"https://api.github.com/users/loganasherjones/followers","following_url":"https://api.github.com/users/loganasherjones/following{/other_user}","gists_url":"https://api.github.com/users/loganasherjones/gists{/gist_id}","starred_url":"https://api.github.com/users/loganasherjones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loganasherjones/subscriptions","organizations_url":"https://api.github.com/users/loganasherjones/orgs","repos_url":"https://api.github.com/users/loganasherjones/repos","events_url":"https://api.github.com/users/loganasherjones/events{/privacy}","received_events_url":"https://api.github.com/users/loganasherjones/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":4,"state":"open","created_at":"2018-05-22T02:35:32Z","updated_at":"2018-05-28T02:09:24Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-03-28T23:46:00Z","updated_at":"2018-05-28T02:31:27Z","closed_at":null,"author_association":"OWNER","body":"It would be nice to be able to list a particular item as a 'watched' item. We would be constantly watching for changes to that item via some source. I need to flesh this out a little bit more, but something like this:\r\n\r\n```python\r\nconfig = spec.load_config(source1, source2, source3)\r\nthread = threading.Thread(target=spec.watch, config)\r\nthread.start()\r\nthread.daemon()\r\n```\r\n\r\nOr possibly something like\r\n\r\n```python\r\nconfig = spec.load_config(source1, source2, source3)\r\nspec.spawn_watcher(config, source1, source2, source3)\r\n```\r\n\r\nThat way you could specify which configs you want to watch."},"comment":{"url":"https://api.github.com/repos/loganasherjones/yapconf/issues/comments/392403281","html_url":"https://github.com/loganasherjones/yapconf/issues/36#issuecomment-392403281","issue_url":"https://api.github.com/repos/loganasherjones/yapconf/issues/36","id":392403281,"user":{"login":"loganasherjones","id":3633332,"avatar_url":"https://avatars0.githubusercontent.com/u/3633332?v=4","gravatar_id":"","url":"https://api.github.com/users/loganasherjones","html_url":"https://github.com/loganasherjones","followers_url":"https://api.github.com/users/loganasherjones/followers","following_url":"https://api.github.com/users/loganasherjones/following{/other_user}","gists_url":"https://api.github.com/users/loganasherjones/gists{/gist_id}","starred_url":"https://api.github.com/users/loganasherjones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loganasherjones/subscriptions","organizations_url":"https://api.github.com/users/loganasherjones/orgs","repos_url":"https://api.github.com/users/loganasherjones/repos","events_url":"https://api.github.com/users/loganasherjones/events{/privacy}","received_events_url":"https://api.github.com/users/loganasherjones/received_events","type":"User","site_admin":false},"created_at":"2018-05-28T02:31:27Z","updated_at":"2018-05-28T02:31:27Z","author_association":"OWNER","body":"Okay, I think I've settled on the following:\r\n\r\n```python\r\ndef handle_config_change(old_config, new_config):\r\n    #TODO: Handle config change\r\n    pass\r\n\r\nspec.add_source('label', 'json', filename='/path/to/json')\r\nspec.spawn_watcher('label', target=handle_config_change)\r\n```\r\n\r\nIn addition, you should be able to specify targets for individual config items:\r\n\r\n```python\r\ndef handle_foo_change(old_foo, new_foo):\r\n    # TODO: Handle foo change\r\n    pass\r\n\r\nspec = YapconfSpec({'foo': {'watch_target': handle_foo_change}})\r\nspec.add_source('label', 'json', filename='/path/to/json')\r\nspec.spawn_watcher('label')\r\n```"}}
{"actor":{"display_login":"loganasherjones"}}