{"action":"created","issue":{"url":"https://api.github.com/repos/juttle/juttle/issues/49","labels_url":"https://api.github.com/repos/juttle/juttle/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/juttle/juttle/issues/49/comments","events_url":"https://api.github.com/repos/juttle/juttle/issues/49/events","html_url":"https://github.com/juttle/juttle/issues/49","id":123712824,"number":49,"title":"Decide which events system to use","user":{"login":"dmehra","id":5817365,"avatar_url":"https://avatars.githubusercontent.com/u/5817365?v=3","gravatar_id":"","url":"https://api.github.com/users/dmehra","html_url":"https://github.com/dmehra","followers_url":"https://api.github.com/users/dmehra/followers","following_url":"https://api.github.com/users/dmehra/following{/other_user}","gists_url":"https://api.github.com/users/dmehra/gists{/gist_id}","starred_url":"https://api.github.com/users/dmehra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmehra/subscriptions","organizations_url":"https://api.github.com/users/dmehra/orgs","repos_url":"https://api.github.com/users/dmehra/repos","events_url":"https://api.github.com/users/dmehra/events{/privacy}","received_events_url":"https://api.github.com/users/dmehra/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/juttle/juttle/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/juttle/juttle/labels/triaged","name":"triaged","color":"800080"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-23T19:37:03Z","updated_at":"2016-01-05T21:47:42Z","closed_at":null,"body":"@mstemm: We should try to use just a single events system. Currently we're mostly using backbone, but maybe we should use node events instead?\r\n\r\n@demmer: The reason we use Backbone.events is that it works in the browser and node.js.\r\n\r\n@mstemm: matt says now that we use browserify we can use node events in both as well. I don't have a big opinion either way but the run in both advantage of Backbone.events appears to be gone now.\r\n\r\n@mnibecker: eventemitter3 is isomorphic and lets us set context unlike node. lets use that.\r\n\r\n(Note: \"triaged\" label on a \"question\" issue doesn't mean it's been resolved, only that the discussion is cleared to proceed. Our waffle workflow adds that label.)"},"comment":{"url":"https://api.github.com/repos/juttle/juttle/issues/comments/169143671","html_url":"https://github.com/juttle/juttle/issues/49#issuecomment-169143671","issue_url":"https://api.github.com/repos/juttle/juttle/issues/49","id":169143671,"user":{"login":"go-oleg","id":3344137,"avatar_url":"https://avatars.githubusercontent.com/u/3344137?v=3","gravatar_id":"","url":"https://api.github.com/users/go-oleg","html_url":"https://github.com/go-oleg","followers_url":"https://api.github.com/users/go-oleg/followers","following_url":"https://api.github.com/users/go-oleg/following{/other_user}","gists_url":"https://api.github.com/users/go-oleg/gists{/gist_id}","starred_url":"https://api.github.com/users/go-oleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-oleg/subscriptions","organizations_url":"https://api.github.com/users/go-oleg/orgs","repos_url":"https://api.github.com/users/go-oleg/repos","events_url":"https://api.github.com/users/go-oleg/events{/privacy}","received_events_url":"https://api.github.com/users/go-oleg/received_events","type":"User","site_admin":false},"created_at":"2016-01-05T21:47:42Z","updated_at":"2016-01-05T21:47:42Z","body":"I looked into switching to `eventemitter3` and ran into the following problem...\r\n\r\n`eventemitter3` uses `.emit()` instead of `.trigger()` to fire events so it may make sense for us to use that as well. However, creates conflict with `.emit()` that our base proc uses to emit points.\r\n\r\nIt would be a pretty big renaming, but what about changing our current `.emit()` to `.send()` and `.consume()` to `.receive()` so there is some symmetry?\r\n\r\nRelevant lines to how procs and the program fire events:\r\n\r\n[proc/base.js - .trigger() on a proc is implemented by calling .trigger() on it's program](https://github.com/juttle/juttle/blob/8fdd196e746bc25cb3bde379c60e6617a9a304f9/lib/runtime/procs/base.js#L211-L216)\r\n\r\n[program.js - during activation, events is mixed into each node's program](https://github.com/juttle/juttle/blob/8fdd196e746bc25cb3bde379c60e6617a9a304f9/lib/program.js#L47-L49)\r\n\r\n[compiler/index.js - add events to the program](https://github.com/juttle/juttle/blob/8fdd196e746bc25cb3bde379c60e6617a9a304f9/lib/compiler/index.js#L49-L60)"}}