{"action":"opened","issue":{"url":"https://api.github.com/repos/cantino/huginn/issues/1228","labels_url":"https://api.github.com/repos/cantino/huginn/issues/1228/labels{/name}","comments_url":"https://api.github.com/repos/cantino/huginn/issues/1228/comments","events_url":"https://api.github.com/repos/cantino/huginn/issues/1228/events","html_url":"https://github.com/cantino/huginn/issues/1228","id":127018706,"number":1228,"title":"[Suggestion] : allow manual event generator to emit a stream of events","user":{"login":"ohingardail","id":4740482,"avatar_url":"https://avatars.githubusercontent.com/u/4740482?v=3","gravatar_id":"","url":"https://api.github.com/users/ohingardail","html_url":"https://github.com/ohingardail","followers_url":"https://api.github.com/users/ohingardail/followers","following_url":"https://api.github.com/users/ohingardail/following{/other_user}","gists_url":"https://api.github.com/users/ohingardail/gists{/gist_id}","starred_url":"https://api.github.com/users/ohingardail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohingardail/subscriptions","organizations_url":"https://api.github.com/users/ohingardail/orgs","repos_url":"https://api.github.com/users/ohingardail/repos","events_url":"https://api.github.com/users/ohingardail/events{/privacy}","received_events_url":"https://api.github.com/users/ohingardail/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-16T11:34:19Z","updated_at":"2016-01-16T11:34:19Z","closed_at":null,"body":"As far as I can tell, the manual event generator can only emit one event at a time.\r\n\r\nYou put this in :\r\n```\r\n{\r\n  \"A\": \"1\",\r\n  \"B\": \"2\"\r\n}\r\n```\r\n... and you get the same out.\r\n\r\nThis is usually fine for most unit testing, but I have already been tripped up by a fault (#1222, now fixed) where the receiving agent behaved differently with a stream of incoming events.\r\n\r\nI tried something like this on the manual event generator :\r\n```\r\n[\r\n{\r\n  \"A\": \"1\",\r\n  \"B\": \"2\"\r\n},\r\n{\r\n  \"C\": \"3\",\r\n  \"D\": \"4\"\r\n}\r\n]\r\n```\r\n... but what I got out was this : \r\n```\r\n{\r\n  \"0\": {\r\n    \"A\": \"1\",\r\n    \"B\": \"2\"\r\n  },\r\n  \"1\": {\r\n    \"C\": \"3\",\r\n    \"D\": \"4\"\r\n  }\r\n}\r\n```\r\n... which (I think) is still one event containing an array of hashes.\r\n\r\nI can see why getting a single run of a single agent to produce multiple events could be awkward, but it would be useful! The best approach at the moment is to wire up a 'real' agent that emits 'real' events; this works, but it's sometimes easier to identify problems with the hand-crafted data that the manual event generator allows. "}}