Permalink
Browse files

Closes #1152 Introduce LiftRules.cometProcessingTimeout to have conf…

…igurable timeout for comet-requests
  • Loading branch information...
andreak committed Nov 18, 2011
1 parent 4381c22 commit fd99d89e6e89269a2e2c5c9fdb04ac097b28758b
@@ -623,6 +623,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
@@ -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.