{"action":"created","comment":{"url":"https://api.github.com/repos/lift/framework/pulls/comments/51348387","id":51348387,"diff_hunk":"@@ -915,6 +915,118 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable {\n     ajaxEnd = Full(f: () => JsCmd)\n   }\n \n+  private [http] val ajaxAddMetaDefaultFunc:JsVar => JsCmd = toSend => Noop\n+  private [http] val ajaxQueueSortDefaultFunc:JsVar => JsCmd = ajaxQueue => JE.Call(\"lift.ajaxQueueSortDefault\", ajaxQueue)\n+\n+  /**\n+    * Sets the `ajaxAddMeta()` and `ajaxQueueSort()` javascript functions, allowing the application's ajax\n+    * retry logic to be configured.\n+    *\n+    * By default, Lift will retry failed ajax requests with an exponential backoff (see `LiftRules.ajaxCalcRetryTimeFunc`),\n+    * allowing messages to arrive at the server in a shuffled order during periods of failed communications with the server.\n+    *\n+    * Alternatively, you can have Lift never send messages out of order:\n+    * {{{\n+    * LiftRules.ajaxAddMetaAndQueueSortFuncs.default.set(() => LiftRules.ajaxAddMetaAndQueueSortInOrderReceivedFuncs)\n+    * }}}\n+    *\n+    * You could also define your own message ordering policy.\n+    *\n+    * Note: The function you provide is run in the context of a request, allowing you to have conditional logic for\n+    * setting these functions.  For instance, you could have on URL which serves an application requiring ordered\n+    * messages, while others do not.  Example:\n+    * {{{\n+    * LiftRules.ajaxAddMetaAndQueueSortFuncs.default.set { () =>\n+    *   S.request match {\n+    *     case Full(Req(\"ordered\" :: Nil, _, _)) => LiftRules.ajaxAddMetaAndQueueSortInOrderReceivedFuncs\n+    *     case _ => LiftRules.ajaxAddMetaAndQueueSortDefaultFuncs\n+    *   }\n+    * }\n+    * }}}\n+    *\n+    */\n+  val ajaxAddMetaAndQueueSortFuncs: FactoryMaker[Box[(JsVar => JsCmd, JsVar => JsCmd)]] = new FactoryMaker[Box[(JsVar => JsCmd, JsVar => JsCmd)]]( () =>\n+    Full((ajaxAddMetaDefaultFunc, ajaxQueueSortDefaultFunc))\n+  ) {}\n+","path":"web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala","position":37,"original_position":37,"commit_id":"54a80797ac35ea9bfcf689de1f4fbae708a8cb81","original_commit_id":"dcc8fea6b262ed6aeda883c70f29cf3debfa3035","user":{"login":"farmdawgnation","id":620189,"avatar_url":"https://avatars.githubusercontent.com/u/620189?v=3","gravatar_id":"","url":"https://api.github.com/users/farmdawgnation","html_url":"https://github.com/farmdawgnation","followers_url":"https://api.github.com/users/farmdawgnation/followers","following_url":"https://api.github.com/users/farmdawgnation/following{/other_user}","gists_url":"https://api.github.com/users/farmdawgnation/gists{/gist_id}","starred_url":"https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farmdawgnation/subscriptions","organizations_url":"https://api.github.com/users/farmdawgnation/orgs","repos_url":"https://api.github.com/users/farmdawgnation/repos","events_url":"https://api.github.com/users/farmdawgnation/events{/privacy}","received_events_url":"https://api.github.com/users/farmdawgnation/received_events","type":"User","site_admin":false},"body":"Could we have this `FactoryMaker` vend some case class instead of a tuple? Would make the code a lot easier to reason about while scanning. And would also avoid client code doing a lot of `_1` and `_2`.","created_at":"2016-01-30T18:03:36Z","updated_at":"2016-01-30T18:03:36Z","html_url":"https://github.com/lift/framework/pull/1762#discussion_r51348387","pull_request_url":"https://api.github.com/repos/lift/framework/pulls/1762","_links":{"self":{"href":"https://api.github.com/repos/lift/framework/pulls/comments/51348387"},"html":{"href":"https://github.com/lift/framework/pull/1762#discussion_r51348387"},"pull_request":{"href":"https://api.github.com/repos/lift/framework/pulls/1762"}}},"pull_request":{"url":"https://api.github.com/repos/lift/framework/pulls/1762","id":57712121,"html_url":"https://github.com/lift/framework/pull/1762","diff_url":"https://github.com/lift/framework/pull/1762.diff","patch_url":"https://github.com/lift/framework/pull/1762.patch","issue_url":"https://api.github.com/repos/lift/framework/issues/1762","number":1762,"state":"open","locked":false,"title":"Ajax retry configuration","user":{"login":"joescii","id":882948,"avatar_url":"https://avatars.githubusercontent.com/u/882948?v=3","gravatar_id":"","url":"https://api.github.com/users/joescii","html_url":"https://github.com/joescii","followers_url":"https://api.github.com/users/joescii/followers","following_url":"https://api.github.com/users/joescii/following{/other_user}","gists_url":"https://api.github.com/users/joescii/gists{/gist_id}","starred_url":"https://api.github.com/users/joescii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joescii/subscriptions","organizations_url":"https://api.github.com/users/joescii/orgs","repos_url":"https://api.github.com/users/joescii/repos","events_url":"https://api.github.com/users/joescii/events{/privacy}","received_events_url":"https://api.github.com/users/joescii/received_events","type":"User","site_admin":false},"body":"This PR is to give Lift applications more control over ajax retries.  With these changes an application can change the ajax queue's sorting logic and retry timeout calculation.  \r\n\r\nSee [this ML thread](https://groups.google.com/forum/#!topic/liftweb/0z6SV0ucEW4) for some discussion regarding this idea.","created_at":"2016-01-29T22:30:35Z","updated_at":"2016-01-30T18:03:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e63235efe06a5fcd6cb2d35d97369c8d97751588","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lift/framework/pulls/1762/commits","review_comments_url":"https://api.github.com/repos/lift/framework/pulls/1762/comments","review_comment_url":"https://api.github.com/repos/lift/framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lift/framework/issues/1762/comments","statuses_url":"https://api.github.com/repos/lift/framework/statuses/54a80797ac35ea9bfcf689de1f4fbae708a8cb81","head":{"label":"lift:ajax-retry-in-order","ref":"ajax-retry-in-order","sha":"54a80797ac35ea9bfcf689de1f4fbae708a8cb81","user":{"login":"lift","id":317975,"avatar_url":"https://avatars.githubusercontent.com/u/317975?v=3","gravatar_id":"","url":"https://api.github.com/users/lift","html_url":"https://github.com/lift","followers_url":"https://api.github.com/users/lift/followers","following_url":"https://api.github.com/users/lift/following{/other_user}","gists_url":"https://api.github.com/users/lift/gists{/gist_id}","starred_url":"https://api.github.com/users/lift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lift/subscriptions","organizations_url":"https://api.github.com/users/lift/orgs","repos_url":"https://api.github.com/users/lift/repos","events_url":"https://api.github.com/users/lift/events{/privacy}","received_events_url":"https://api.github.com/users/lift/received_events","type":"Organization","site_admin":false},"repo":{"id":1295197,"name":"framework","full_name":"lift/framework","owner":{"login":"lift","id":317975,"avatar_url":"https://avatars.githubusercontent.com/u/317975?v=3","gravatar_id":"","url":"https://api.github.com/users/lift","html_url":"https://github.com/lift","followers_url":"https://api.github.com/users/lift/followers","following_url":"https://api.github.com/users/lift/following{/other_user}","gists_url":"https://api.github.com/users/lift/gists{/gist_id}","starred_url":"https://api.github.com/users/lift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lift/subscriptions","organizations_url":"https://api.github.com/users/lift/orgs","repos_url":"https://api.github.com/users/lift/repos","events_url":"https://api.github.com/users/lift/events{/privacy}","received_events_url":"https://api.github.com/users/lift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lift/framework","description":"Lift Framework","fork":false,"url":"https://api.github.com/repos/lift/framework","forks_url":"https://api.github.com/repos/lift/framework/forks","keys_url":"https://api.github.com/repos/lift/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lift/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lift/framework/teams","hooks_url":"https://api.github.com/repos/lift/framework/hooks","issue_events_url":"https://api.github.com/repos/lift/framework/issues/events{/number}","events_url":"https://api.github.com/repos/lift/framework/events","assignees_url":"https://api.github.com/repos/lift/framework/assignees{/user}","branches_url":"https://api.github.com/repos/lift/framework/branches{/branch}","tags_url":"https://api.github.com/repos/lift/framework/tags","blobs_url":"https://api.github.com/repos/lift/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lift/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lift/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/lift/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lift/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/lift/framework/languages","stargazers_url":"https://api.github.com/repos/lift/framework/stargazers","contributors_url":"https://api.github.com/repos/lift/framework/contributors","subscribers_url":"https://api.github.com/repos/lift/framework/subscribers","subscription_url":"https://api.github.com/repos/lift/framework/subscription","commits_url":"https://api.github.com/repos/lift/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/lift/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/lift/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/lift/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/lift/framework/contents/{+path}","compare_url":"https://api.github.com/repos/lift/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lift/framework/merges","archive_url":"https://api.github.com/repos/lift/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lift/framework/downloads","issues_url":"https://api.github.com/repos/lift/framework/issues{/number}","pulls_url":"https://api.github.com/repos/lift/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/lift/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/lift/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lift/framework/labels{/name}","releases_url":"https://api.github.com/repos/lift/framework/releases{/id}","deployments_url":"https://api.github.com/repos/lift/framework/deployments","created_at":"2011-01-26T13:25:28Z","updated_at":"2016-01-29T22:41:35Z","pushed_at":"2016-01-30T16:14:06Z","git_url":"git://github.com/lift/framework.git","ssh_url":"git@github.com:lift/framework.git","clone_url":"https://github.com/lift/framework.git","svn_url":"https://github.com/lift/framework","homepage":"http://liftweb.net","size":22262,"stargazers_count":966,"watchers_count":966,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":229,"mirror_url":null,"open_issues_count":133,"forks":229,"open_issues":133,"watchers":966,"default_branch":"master"}},"base":{"label":"lift:master","ref":"master","sha":"e528fc9c8b38cea61ca011f5a5357cd15698daf8","user":{"login":"lift","id":317975,"avatar_url":"https://avatars.githubusercontent.com/u/317975?v=3","gravatar_id":"","url":"https://api.github.com/users/lift","html_url":"https://github.com/lift","followers_url":"https://api.github.com/users/lift/followers","following_url":"https://api.github.com/users/lift/following{/other_user}","gists_url":"https://api.github.com/users/lift/gists{/gist_id}","starred_url":"https://api.github.com/users/lift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lift/subscriptions","organizations_url":"https://api.github.com/users/lift/orgs","repos_url":"https://api.github.com/users/lift/repos","events_url":"https://api.github.com/users/lift/events{/privacy}","received_events_url":"https://api.github.com/users/lift/received_events","type":"Organization","site_admin":false},"repo":{"id":1295197,"name":"framework","full_name":"lift/framework","owner":{"login":"lift","id":317975,"avatar_url":"https://avatars.githubusercontent.com/u/317975?v=3","gravatar_id":"","url":"https://api.github.com/users/lift","html_url":"https://github.com/lift","followers_url":"https://api.github.com/users/lift/followers","following_url":"https://api.github.com/users/lift/following{/other_user}","gists_url":"https://api.github.com/users/lift/gists{/gist_id}","starred_url":"https://api.github.com/users/lift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lift/subscriptions","organizations_url":"https://api.github.com/users/lift/orgs","repos_url":"https://api.github.com/users/lift/repos","events_url":"https://api.github.com/users/lift/events{/privacy}","received_events_url":"https://api.github.com/users/lift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lift/framework","description":"Lift Framework","fork":false,"url":"https://api.github.com/repos/lift/framework","forks_url":"https://api.github.com/repos/lift/framework/forks","keys_url":"https://api.github.com/repos/lift/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lift/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lift/framework/teams","hooks_url":"https://api.github.com/repos/lift/framework/hooks","issue_events_url":"https://api.github.com/repos/lift/framework/issues/events{/number}","events_url":"https://api.github.com/repos/lift/framework/events","assignees_url":"https://api.github.com/repos/lift/framework/assignees{/user}","branches_url":"https://api.github.com/repos/lift/framework/branches{/branch}","tags_url":"https://api.github.com/repos/lift/framework/tags","blobs_url":"https://api.github.com/repos/lift/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lift/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lift/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/lift/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lift/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/lift/framework/languages","stargazers_url":"https://api.github.com/repos/lift/framework/stargazers","contributors_url":"https://api.github.com/repos/lift/framework/contributors","subscribers_url":"https://api.github.com/repos/lift/framework/subscribers","subscription_url":"https://api.github.com/repos/lift/framework/subscription","commits_url":"https://api.github.com/repos/lift/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/lift/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/lift/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/lift/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/lift/framework/contents/{+path}","compare_url":"https://api.github.com/repos/lift/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lift/framework/merges","archive_url":"https://api.github.com/repos/lift/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lift/framework/downloads","issues_url":"https://api.github.com/repos/lift/framework/issues{/number}","pulls_url":"https://api.github.com/repos/lift/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/lift/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/lift/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lift/framework/labels{/name}","releases_url":"https://api.github.com/repos/lift/framework/releases{/id}","deployments_url":"https://api.github.com/repos/lift/framework/deployments","created_at":"2011-01-26T13:25:28Z","updated_at":"2016-01-29T22:41:35Z","pushed_at":"2016-01-30T16:14:06Z","git_url":"git://github.com/lift/framework.git","ssh_url":"git@github.com:lift/framework.git","clone_url":"https://github.com/lift/framework.git","svn_url":"https://github.com/lift/framework","homepage":"http://liftweb.net","size":22262,"stargazers_count":966,"watchers_count":966,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":229,"mirror_url":null,"open_issues_count":133,"forks":229,"open_issues":133,"watchers":966,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lift/framework/pulls/1762"},"html":{"href":"https://github.com/lift/framework/pull/1762"},"issue":{"href":"https://api.github.com/repos/lift/framework/issues/1762"},"comments":{"href":"https://api.github.com/repos/lift/framework/issues/1762/comments"},"review_comments":{"href":"https://api.github.com/repos/lift/framework/pulls/1762/comments"},"review_comment":{"href":"https://api.github.com/repos/lift/framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lift/framework/pulls/1762/commits"},"statuses":{"href":"https://api.github.com/repos/lift/framework/statuses/54a80797ac35ea9bfcf689de1f4fbae708a8cb81"}}}}