Skip to content

Commit

Permalink
Added a method to release all the long polling connections
Browse files Browse the repository at this point in the history
  • Loading branch information
dpp authored and Naftoli Gugenheim committed Oct 24, 2012
1 parent c27847d commit 2235bdf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala
Expand Up @@ -87,6 +87,8 @@ object LiftSession {
*/
var onEndServicing: List[(LiftSession, Req, Box[LiftResponse]) => Unit] = Nil



@volatile private var constructorCache: Map[(Class[_], Box[Class[_]]), Box[ConstructorType]] = Map()

private[http] def constructFrom[T](session: LiftSession, pp: Box[ParamPair], clz: Class[T]): Box[T] = {
Expand Down Expand Up @@ -211,6 +213,18 @@ object SessionMaster extends LiftActor with Loggable {
}
}


/**
* End comet long polling for all sessions. This allows a clean reload of Nginx
* because Nginx children stick around for long polling.
*/
def breakOutAllComet() {
val ses = lockRead(sessions)
ses.valuesIterator.foreach {
_.session.breakOutComet()
}
}

def getSession(id: String, otherId: Box[String]): Box[LiftSession] = lockAndBump {
otherId.flatMap(sessions.get) or Box(sessions.get(id))
}
Expand Down

0 comments on commit 2235bdf

Please sign in to comment.