Skip to content
Browse files

Closes #1152 Introduce LiftRules.cometProcessingTimeout to have confi…

…gurable timeout for comet-requests
  • Loading branch information...
1 parent 4381c22 commit fd99d89e6e89269a2e2c5c9fdb04ac097b28758b @andreak andreak committed Nov 18, 2011
View
5 web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
@@ -624,6 +624,11 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable {
@volatile var cometFailureRetryTimeout: Long = 10 seconds
/**
+ * The optional timeot of a comet-request. If Empty, wait forever
+ */
+ @volatile var cometProcessingTimeout: Long = 5 seconds
+
+ /**
* The dispatcher that takes a Snippet and converts it to a
* DispatchSnippet instance
*/
View
4 web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala
@@ -659,7 +659,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
// if it's going to a CometActor, batch up the commands
case Full(id) if asyncById.contains(id) =>
asyncById.get(id).toList.
- flatMap(a => a.!?(5000L, ActionMessageSet(f.map(i => buildFunc(i)), state)) match {
+ flatMap(a => a.!?(LiftRules.cometProcessingTimeout, ActionMessageSet(f.map(i => buildFunc(i)), state)) match {
case Full(li: List[_]) => li
case li: List[_] => li
case other => Nil
@@ -1883,7 +1883,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
case text: Text => text
case unparsed: Unparsed => unparsed
- case a: Atom[Any] if a.getClass().getName() == "scala.xml.Atom" => new Text(a.data.toString)
+ case a: Atom[Any] if (a.getClass == classOf[Atom[Any]]) => new Text(a.data.toString)
case v => v
}

0 comments on commit fd99d89

Please sign in to comment.
Something went wrong with that request. Please try again.