{"action":"opened","issue":{"url":"https://api.github.com/repos/square/crossfilter/issues/166","labels_url":"https://api.github.com/repos/square/crossfilter/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/square/crossfilter/issues/166/comments","events_url":"https://api.github.com/repos/square/crossfilter/issues/166/events","html_url":"https://github.com/square/crossfilter/issues/166","id":119359147,"number":166,"title":"Execute group asynchronously","user":{"login":"yosiat","id":306253,"avatar_url":"https://avatars.githubusercontent.com/u/306253?v=3","gravatar_id":"","url":"https://api.github.com/users/yosiat","html_url":"https://github.com/yosiat","followers_url":"https://api.github.com/users/yosiat/followers","following_url":"https://api.github.com/users/yosiat/following{/other_user}","gists_url":"https://api.github.com/users/yosiat/gists{/gist_id}","starred_url":"https://api.github.com/users/yosiat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosiat/subscriptions","organizations_url":"https://api.github.com/users/yosiat/orgs","repos_url":"https://api.github.com/users/yosiat/repos","events_url":"https://api.github.com/users/yosiat/events{/privacy}","received_events_url":"https://api.github.com/users/yosiat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-29T12:53:03Z","updated_at":"2015-11-29T12:53:03Z","closed_at":null,"body":"Hi,\r\n\r\nI am currently working on a project (in a node environment, specifically electron) where I need to load dataset which is larger than the maximum js heap.\r\nFor doing so, I am creating a library that mimics the crossfilter API and execute the group and filters in sqlite store.\r\n\r\nAs a result the developer is calling filter(..)/filterFunction(..) etc and when he is calling \"group()\" or \"groupAll()\" a sql query executed (matching the filters criteria),\r\nthe result is asynchronous (I thought about waiting sync for the sql query to finish but then I will block the UI for 200ms ~).\r\n\r\nCurrently my approach for doing this, is something like this:\r\n\r\n```js\r\nfunction promiseGroup(promise) {\r\n  return {\r\n    all: function() {\r\n        if(promise resolved)  {\r\n                 return promise values;\r\n        }\r\n\r\n\r\n       return old results;\r\n    }\r\n  }\r\n}\r\n\r\n\r\ngroup: function() {\r\n   /*\r\n      I have some code for making the filters is new one,\r\n      If I won't do this my code will result in infinite loop (dc.redrawAll -> calls group -> execute -> dc.redrawAll)\r\n   */\r\n   var sqlPromise = /* code that execute the promise */;\r\n   sqlPromise.then(function() {\r\n      // when the promise is returned we want to call dc.redraw \r\n     dc.redrawAll();\r\n   });\r\n   return promiseGroup(sqlPromise);\r\n\r\n}\r\n```\r\n\r\nDo you have any other way for doing this? Maybe adding support to crossfilter for async groups? and supporting this for dc (I will be more than happy to sumit PR)?\r\n"}}