Skip to content

Commit

Permalink
Revert "Don't suspend requests too early for the first request."
Browse files Browse the repository at this point in the history
This reverts commit 70ffcba.
  • Loading branch information
fmpwizard committed Aug 31, 2012
1 parent 1d9840e commit e686682
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions web/webkit/src/main/scala/net/liftweb/http/LiftServlet.scala
Expand Up @@ -626,6 +626,8 @@ class LiftServlet extends Loggable {
(renderVersion -> (renderVersion ->
AjaxRequestInfo(handlerVersion, Empty, cont :: Nil, millis)) AjaxRequestInfo(handlerVersion, Empty, cont :: Nil, millis))


suspendRequest()

Empty // no response available, triggers the actual AJAX computation below Empty // no response available, triggers the actual AJAX computation below


case AjaxRequestInfo(storedVersion, existingResponseBox @ Full(_), _, _) => case AjaxRequestInfo(storedVersion, existingResponseBox @ Full(_), _, _) =>
Expand All @@ -644,12 +646,14 @@ class LiftServlet extends Loggable {
(renderVersion -> (renderVersion ->
AjaxRequestInfo(handlerVersion, Empty, cont :: Nil, millis)) AjaxRequestInfo(handlerVersion, Empty, cont :: Nil, millis))


suspendRequest()

Empty // no response available, triggers the actual AJAX computation below Empty // no response available, triggers the actual AJAX computation below
} }
} }


toReturn or { toReturn or {
val result = Full(runAjax(requestState, liftSession, Full((result: LiftResponse) => { Full(runAjax(requestState, liftSession, Full((result: LiftResponse) => {
// When we get the response, synchronizedly check that the // When we get the response, synchronizedly check that the
// versions are still the same in the map, and, if so, update // versions are still the same in the map, and, if so, update
// any waiting actors then clear the actor list and update the // any waiting actors then clear the actor list and update the
Expand All @@ -665,10 +669,6 @@ class LiftServlet extends Loggable {
} }
} }
}))) })))

suspendRequest()

result
} openOr Empty } openOr Empty


case _ => case _ =>
Expand Down
Expand Up @@ -573,7 +573,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
*/ */
private var ajaxRequests = scala.collection.mutable.Map[String,AjaxRequestInfo]() private var ajaxRequests = scala.collection.mutable.Map[String,AjaxRequestInfo]()


private[http] def withAjaxRequests[T](fn: (scala.collection.mutable.Map[String, AjaxRequestInfo]) => T): T = { private[http] def withAjaxRequests[T](fn: (scala.collection.mutable.Map[String, AjaxRequestInfo]) => T) = {
ajaxRequests.synchronized { fn(ajaxRequests) } ajaxRequests.synchronized { fn(ajaxRequests) }
} }


Expand Down

0 comments on commit e686682

Please sign in to comment.