{"action":"created","issue":{"url":"https://api.github.com/repos/splone/splonebox-core/issues/60","repository_url":"https://api.github.com/repos/splone/splonebox-core","labels_url":"https://api.github.com/repos/splone/splonebox-core/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/splone/splonebox-core/issues/60/comments","events_url":"https://api.github.com/repos/splone/splonebox-core/issues/60/events","html_url":"https://github.com/splone/splonebox-core/issues/60","id":183724930,"number":60,"title":"API/Connection event subscription mechansim","user":{"login":"stze","id":640612,"avatar_url":"https://avatars.githubusercontent.com/u/640612?v=3","gravatar_id":"","url":"https://api.github.com/users/stze","html_url":"https://github.com/stze","followers_url":"https://api.github.com/users/stze/followers","following_url":"https://api.github.com/users/stze/following{/other_user}","gists_url":"https://api.github.com/users/stze/gists{/gist_id}","starred_url":"https://api.github.com/users/stze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stze/subscriptions","organizations_url":"https://api.github.com/users/stze/orgs","repos_url":"https://api.github.com/users/stze/repos","events_url":"https://api.github.com/users/stze/events{/privacy}","received_events_url":"https://api.github.com/users/stze/received_events","type":"User","site_admin":false},"labels":[{"id":413765538,"url":"https://api.github.com/repos/splone/splonebox-core/labels/RFC","name":"RFC","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":{"login":"stze","id":640612,"avatar_url":"https://avatars.githubusercontent.com/u/640612?v=3","gravatar_id":"","url":"https://api.github.com/users/stze","html_url":"https://github.com/stze","followers_url":"https://api.github.com/users/stze/followers","following_url":"https://api.github.com/users/stze/following{/other_user}","gists_url":"https://api.github.com/users/stze/gists{/gist_id}","starred_url":"https://api.github.com/users/stze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stze/subscriptions","organizations_url":"https://api.github.com/users/stze/orgs","repos_url":"https://api.github.com/users/stze/repos","events_url":"https://api.github.com/users/stze/events{/privacy}","received_events_url":"https://api.github.com/users/stze/received_events","type":"User","site_admin":false},"assignees":[{"login":"stze","id":640612,"avatar_url":"https://avatars.githubusercontent.com/u/640612?v=3","gravatar_id":"","url":"https://api.github.com/users/stze","html_url":"https://github.com/stze","followers_url":"https://api.github.com/users/stze/followers","following_url":"https://api.github.com/users/stze/following{/other_user}","gists_url":"https://api.github.com/users/stze/gists{/gist_id}","starred_url":"https://api.github.com/users/stze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stze/subscriptions","organizations_url":"https://api.github.com/users/stze/orgs","repos_url":"https://api.github.com/users/stze/repos","events_url":"https://api.github.com/users/stze/events{/privacy}","received_events_url":"https://api.github.com/users/stze/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2016-10-18T15:42:07Z","updated_at":"2016-11-16T10:57:32Z","closed_at":null,"body":"As discussed with @bontric we need to introduce an event subscription mechansim. Therefore we need to implement:\n- connection event subscripe/unsubscripe function\n- connection event broadcast function\n\nEvent types are represented as strings and stored in a global hashmap. If a connection subscribes to an event, the event string is saved in a connection event hashmap. In the broadcast function, for every connection we check if it has subscribed to the event, therefore we use the connection event hashmap. Then we send the packet to all connections which subscribed to the event. During the unsubscribe function, the event is removed from the connection event hashmap.\n\nSubscribe/Unsubscribe can be triggered by new API calls _subscribe_ and _unsubscribe_.\n### Subscribe API call\n\n```\n[0, msgid, \"subscribe\", [\"EventName\"]]\n```\n### Unsubscribe API call\n\n```\n[0, msgid, \"unsubscribe\", [\"EventName\"]]\n```\n### Notify\n\nA msgpack-rpc _notification message_ is used for the notify mechanism. The notification message is a msgpack-rpc with method `method` and argument `args`. This will have the same effect as a request, but no response will be recieved.\n\n```\n[2, \"EventName\", args]\n```\n"},"comment":{"url":"https://api.github.com/repos/splone/splonebox-core/issues/comments/260916585","html_url":"https://github.com/splone/splonebox-core/issues/60#issuecomment-260916585","issue_url":"https://api.github.com/repos/splone/splonebox-core/issues/60","id":260916585,"user":{"login":"stze","id":640612,"avatar_url":"https://avatars.githubusercontent.com/u/640612?v=3","gravatar_id":"","url":"https://api.github.com/users/stze","html_url":"https://github.com/stze","followers_url":"https://api.github.com/users/stze/followers","following_url":"https://api.github.com/users/stze/following{/other_user}","gists_url":"https://api.github.com/users/stze/gists{/gist_id}","starred_url":"https://api.github.com/users/stze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stze/subscriptions","organizations_url":"https://api.github.com/users/stze/orgs","repos_url":"https://api.github.com/users/stze/repos","events_url":"https://api.github.com/users/stze/events{/privacy}","received_events_url":"https://api.github.com/users/stze/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T10:57:32Z","updated_at":"2016-11-16T10:57:32Z","body":"> It might be a problem, that as soon as notifications are used to explicitly trigger executions (e.g. redrawing something, saving data), \"notifications\" compete with the traditional \"run\" call. So there should be a clear reason (and maybe a clear definition) when to use notifications and when to use them not.\r\n\r\nnotification is not an API call. notification is a msgpack rpc protocol message type, like request. It does not really compete with the run call. but you are right, we should definitely think about, when to use notifications or request for specific API calls, like run. \r\n\r\n> What is the use case for broadcasts? IMHO, broadcasts are obsolete. If a plugin is interested in a specific kind of information or notification it subscribes to it. An event might be named \"broadcast\", however this is a very unprecise event name and it does not make any sense to me to have such an event.\r\n\r\ni don't understand. without a `broadcast` call, how do plugin's send event's to event subscriber's? otherwise only the core would be able to send event's to event subscribers. the name broadcast is maybe not optimal. do you have an idea what name is more appropriate?"}}
{"actor":{"display_login":"stze"}}