{"action":"created","issue":{"url":"https://api.github.com/repos/inf3rno/dataflower/issues/48","labels_url":"https://api.github.com/repos/inf3rno/dataflower/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/inf3rno/dataflower/issues/48/comments","events_url":"https://api.github.com/repos/inf3rno/dataflower/issues/48/events","html_url":"https://github.com/inf3rno/dataflower/issues/48","id":58792258,"number":48,"title":"Context implementation","user":{"login":"inf3rno","id":408911,"avatar_url":"https://avatars.githubusercontent.com/u/408911?v=3","gravatar_id":"","url":"https://api.github.com/users/inf3rno","html_url":"https://github.com/inf3rno","followers_url":"https://api.github.com/users/inf3rno/followers","following_url":"https://api.github.com/users/inf3rno/following{/other_user}","gists_url":"https://api.github.com/users/inf3rno/gists{/gist_id}","starred_url":"https://api.github.com/users/inf3rno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inf3rno/subscriptions","organizations_url":"https://api.github.com/users/inf3rno/orgs","repos_url":"https://api.github.com/users/inf3rno/repos","events_url":"https://api.github.com/users/inf3rno/events{/privacy}","received_events_url":"https://api.github.com/users/inf3rno/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/inf3rno/dataflower/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"inf3rno","id":408911,"avatar_url":"https://avatars.githubusercontent.com/u/408911?v=3","gravatar_id":"","url":"https://api.github.com/users/inf3rno","html_url":"https://github.com/inf3rno","followers_url":"https://api.github.com/users/inf3rno/followers","following_url":"https://api.github.com/users/inf3rno/following{/other_user}","gists_url":"https://api.github.com/users/inf3rno/gists{/gist_id}","starred_url":"https://api.github.com/users/inf3rno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inf3rno/subscriptions","organizations_url":"https://api.github.com/users/inf3rno/orgs","repos_url":"https://api.github.com/users/inf3rno/repos","events_url":"https://api.github.com/users/inf3rno/events{/privacy}","received_events_url":"https://api.github.com/users/inf3rno/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/inf3rno/dataflower/milestones/4","html_url":"https://github.com/inf3rno/dataflower/milestones/0.9","labels_url":"https://api.github.com/repos/inf3rno/dataflower/milestones/4/labels","id":975070,"number":4,"title":"0.9","description":"Implementing every class in a node.js compatible way. No documentation, no release, no building code, no online testing, etc... After this will I run the browser tests.","creator":{"login":"inf3rno","id":408911,"avatar_url":"https://avatars.githubusercontent.com/u/408911?v=3","gravatar_id":"","url":"https://api.github.com/users/inf3rno","html_url":"https://github.com/inf3rno","followers_url":"https://api.github.com/users/inf3rno/followers","following_url":"https://api.github.com/users/inf3rno/following{/other_user}","gists_url":"https://api.github.com/users/inf3rno/gists{/gist_id}","starred_url":"https://api.github.com/users/inf3rno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inf3rno/subscriptions","organizations_url":"https://api.github.com/users/inf3rno/orgs","repos_url":"https://api.github.com/users/inf3rno/repos","events_url":"https://api.github.com/users/inf3rno/events{/privacy}","received_events_url":"https://api.github.com/users/inf3rno/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":12,"state":"open","created_at":"2015-02-11T10:51:13Z","updated_at":"2015-02-24T19:37:05Z","due_on":"2015-02-27T23:00:00Z","closed_at":null},"comments":20,"created_at":"2015-02-24T19:37:05Z","updated_at":"2015-02-25T11:08:11Z","closed_at":null,"body":"I'll collect the knowledge available about context here."},"comment":{"url":"https://api.github.com/repos/inf3rno/dataflower/issues/comments/75942780","html_url":"https://github.com/inf3rno/dataflower/issues/48#issuecomment-75942780","issue_url":"https://api.github.com/repos/inf3rno/dataflower/issues/48","id":75942780,"user":{"login":"inf3rno","id":408911,"avatar_url":"https://avatars.githubusercontent.com/u/408911?v=3","gravatar_id":"","url":"https://api.github.com/users/inf3rno","html_url":"https://github.com/inf3rno","followers_url":"https://api.github.com/users/inf3rno/followers","following_url":"https://api.github.com/users/inf3rno/following{/other_user}","gists_url":"https://api.github.com/users/inf3rno/gists{/gist_id}","starred_url":"https://api.github.com/users/inf3rno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inf3rno/subscriptions","organizations_url":"https://api.github.com/users/inf3rno/orgs","repos_url":"https://api.github.com/users/inf3rno/repos","events_url":"https://api.github.com/users/inf3rno/events{/privacy}","received_events_url":"https://api.github.com/users/inf3rno/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T11:08:11Z","updated_at":"2015-02-25T11:08:11Z","body":"In this case the context can be the context of the caller. So:\r\n\r\n```js\r\nnetworks[0].p.publish(args);\r\n// context = networks[0].createContext();\r\n```\r\n\r\n```js\r\n    notify: function (context, args){\r\n        this.done(context, args);\r\n    }\r\n```\r\n\r\nWhat if we pass invalid Context to the other Components?\r\nThey will throw Error, or create their own Context. \r\n\r\nWhat if they throw Error? Then I can use only this kind of code:\r\n\r\n```js\r\n    notify: function (context, args){\r\n        this.done(null, args);\r\n    }\r\n```\r\n\r\nor\r\n\r\n```js\r\n    done: function (args){\r\n        for (var id in subscribers)\r\n                if (this.context.contains(subscribers[id])\r\n                        subscribers[id].receive(this.context, args);\r\n                else\r\n                        subscribers[id].receive(null, args); // or send in the superContext\r\n    }\r\n```\r\n\r\nNow this is interesting. So in this case I can have multiple clones from the same Subscription depending on the Publisher Context. Why can this work by Subscriptions and why not by Components?"}}