Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Closes #1153 Easier customisation of comet-timeouts.

  • Loading branch information...
commit 50d6f2acae46cd8e1fe5eae4ef48a58fa017e4f0 1 parent e04ee61
@andreak andreak authored
View
2  web/webkit/src/main/scala/net/liftweb/builtin/snippet/Comet.scala
@@ -65,7 +65,7 @@ object Comet extends DispatchSnippet with LazyLoggable {
c ! UpdateDefaultXml(kids)
}
- (c.!?(26600L, AskRender)) match {
+ (c.!?(c.cometRenderTimeout, AskRender)) match {
case Full(AnswerRender(response, _, when, _)) if c.hasOuter =>
buildSpan(Empty, c.buildSpan(when, response.inSpan) ++ response.outSpan, c, c.uniqueId+"_outer")
View
10 web/webkit/src/main/scala/net/liftweb/http/CometActor.scala
@@ -393,6 +393,16 @@ trait LiftCometActor extends TypedActor[Any, Any] with ForwardableActor[Any, Any
initCometActor(theSession, theType, name, defaultHtml, attributes)
}
+ /**
+ * Override in sub-class to customise timeout for the render()-method for the specific comet
+ */
+ def cometRenderTimeout = LiftRules.cometRenderTimeout
+
+ /**
+ * Override in sub-class to customise timeout for AJAX-requests to the comet-component for the specific comet
+ */
+ def cometProcessingTimeout = LiftRules.cometProcessingTimeout
+
protected def initCometActor(theSession: LiftSession,
theType: Box[String],
name: Box[String],
View
7 web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
@@ -624,11 +624,16 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable {
@volatile var cometFailureRetryTimeout: Long = 10 seconds
/**
- * The optional timeout in milliseconds of a comet-request. Defaults to 5000 ms.
+ * The timeout in milliseconds of a comet ajax-request. Defaults to 5000 ms.
*/
@volatile var cometProcessingTimeout: Long = 5 seconds
/**
+ * The timeout in milliseconds of a comet render-request. Defaults to 30000 ms.
+ */
+ @volatile var cometRenderTimeout: Long = 30 seconds
+
+ /**
* The dispatcher that takes a Snippet and converts it to a
* DispatchSnippet instance
*/
View
5 web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala
@@ -657,9 +657,8 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
val f = toRun.filter(_.owner == w)
w match {
// 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.!?(LiftRules.cometProcessingTimeout, ActionMessageSet(f.map(i => buildFunc(i)), state)) match {
+ case Full(id) if asyncById.contains(id) => asyncById.get(id).toList.flatMap(a =>
+ a.!?(a.cometProcessingTimeout, ActionMessageSet(f.map(i => buildFunc(i)), state)) match {
case Full(li: List[_]) => li
case li: List[_] => li
case other => Nil
Please sign in to comment.
Something went wrong with that request. Please try again.