{"action":"created","issue":{"url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/239","labels_url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/239/comments","events_url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/239/events","html_url":"https://github.com/ozone-development/ozp-iwc/issues/239","id":62358149,"number":239,"title":"Create an AjaxPersistenceQueue to throttle and de-duplicate API persistence to the server.","user":{"login":"nialscorva","id":178918,"avatar_url":"https://avatars.githubusercontent.com/u/178918?v=3","gravatar_id":"","url":"https://api.github.com/users/nialscorva","html_url":"https://github.com/nialscorva","followers_url":"https://api.github.com/users/nialscorva/followers","following_url":"https://api.github.com/users/nialscorva/following{/other_user}","gists_url":"https://api.github.com/users/nialscorva/gists{/gist_id}","starred_url":"https://api.github.com/users/nialscorva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nialscorva/subscriptions","organizations_url":"https://api.github.com/users/nialscorva/orgs","repos_url":"https://api.github.com/users/nialscorva/repos","events_url":"https://api.github.com/users/nialscorva/events{/privacy}","received_events_url":"https://api.github.com/users/nialscorva/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ozone-development/ozp-iwc/labels/5%20-%20Staging-QA","name":"5 - Staging-QA","color":"CCCCCC"},{"url":"https://api.github.com/repos/ozone-development/ozp-iwc/labels/API:%20Common","name":"API: Common","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ozone-development/ozp-iwc/milestones/7","html_url":"https://github.com/ozone-development/ozp-iwc/milestones/v0.3.0%20-%20Hardening","labels_url":"https://api.github.com/repos/ozone-development/ozp-iwc/milestones/7/labels","id":998714,"number":7,"title":"v0.3.0 - Hardening","description":"Take a step back and solidify the product:\r\n- fix various bugs\r\n- improve the leadership election\r\n- audit and improve test coverage\r\n- optimizations and tooling","creator":{"login":"nialscorva","id":178918,"avatar_url":"https://avatars.githubusercontent.com/u/178918?v=3","gravatar_id":"","url":"https://api.github.com/users/nialscorva","html_url":"https://github.com/nialscorva","followers_url":"https://api.github.com/users/nialscorva/followers","following_url":"https://api.github.com/users/nialscorva/following{/other_user}","gists_url":"https://api.github.com/users/nialscorva/gists{/gist_id}","starred_url":"https://api.github.com/users/nialscorva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nialscorva/subscriptions","organizations_url":"https://api.github.com/users/nialscorva/orgs","repos_url":"https://api.github.com/users/nialscorva/repos","events_url":"https://api.github.com/users/nialscorva/events{/privacy}","received_events_url":"https://api.github.com/users/nialscorva/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":11,"state":"open","created_at":"2015-02-27T12:28:53Z","updated_at":"2015-07-01T14:51:42Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-03-17T10:41:30Z","updated_at":"2015-07-01T15:02:52Z","closed_at":null,"body":"Create an AjaxPersistenceQueue class to handle the logic of persisting API resources back to the server with the following constraints:\n* A maximum number of in-flight connections to the server at any given time (default: 4).\n* A resource can only be in the queue once.\n  * If a resource is queued while it's waiting for the connection pool, simply update the entry.\n  * If a resource is queued while it's save is in flight, queue it to save *after* the current request completes.\n* PUT and DELETE to the node's `self` URL to create, update, or delete it.\n\nInterface:\nConstructor: `ozpIwc.AjaxPersistenceQueue(config)`\n* Param {integer} [config.poolSize=4] - how many connections to allow at one time.\n\n`AjaxPersistenceQueue.prototype.queueNode(iwcUri,node)`\n* Param: {string} iwcUri - the iwcUri, minus protocol (e.g. \"data.api/foo/bar\", \"system.api/application/12345\")\n* Param {ApiNode} node - the ApiNode to be queued for save\n* Returns {Promise} - a promise that resolves when the resource has been successfully saved\n\r\n\r\n<!---\r\n@huboard:{\"order\":59.10205078125,\"milestone_order\":239,\"custom_state\":\"\"}\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/comments/117709300","html_url":"https://github.com/ozone-development/ozp-iwc/issues/239#issuecomment-117709300","issue_url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/239","id":117709300,"user":{"login":"Kevin-K","id":7290455,"avatar_url":"https://avatars.githubusercontent.com/u/7290455?v=3","gravatar_id":"","url":"https://api.github.com/users/Kevin-K","html_url":"https://github.com/Kevin-K","followers_url":"https://api.github.com/users/Kevin-K/followers","following_url":"https://api.github.com/users/Kevin-K/following{/other_user}","gists_url":"https://api.github.com/users/Kevin-K/gists{/gist_id}","starred_url":"https://api.github.com/users/Kevin-K/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kevin-K/subscriptions","organizations_url":"https://api.github.com/users/Kevin-K/orgs","repos_url":"https://api.github.com/users/Kevin-K/repos","events_url":"https://api.github.com/users/Kevin-K/events{/privacy}","received_events_url":"https://api.github.com/users/Kevin-K/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T15:02:52Z","updated_at":"2015-07-01T15:02:52Z","body":"Due to Ozone Platform backend complications, default number of in-flight connections changed from [4 to 1](https://github.com/ozone-development/ozp-iwc/blob/53258cb7b2018639dc1bbb481c59426270f8b49e/app/js/bus/util/ajaxPersistenceQueue.js#L10).\n\nThis is easily changed for other backend implementations/Ozone Platform backend enhancements. \nWhen [instantiating an API in the defaultWiring.js](https://github.com/ozone-development/ozp-iwc/blob/53258cb7b2018639dc1bbb481c59426270f8b49e/app/js/defaultWiring.js#L71) add a custom `persistenceQueue` to its config.\n```\n ozpIwc.dataApi = new ozpIwc.DataApi({\n    'name': \"data.api\",\n    'poolSize': 4\n});\n```"}}