Permalink
Browse files

Closes #1140 Added onListenersListEmptied() to ListenerManager to be …

…able to react when listerners-list is emptied
  • Loading branch information...
1 parent 32fc95b commit ddf1cb844898181341ecb2d7b5050a8cdfae5a6f @andreak andreak committed Nov 2, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 web/webkit/src/main/scala/net/liftweb/http/CometActor.scala
@@ -247,9 +247,19 @@ trait ListenerManager {
case RemoveAListener(who) =>
listeners = listeners.filter(_._1 ne who)
+ if (listeners.isEmpty) {
+ onListenersListEmptied()
+ }
}
/**
+ * Called after RemoveAListener-message is processed and no more listeners exist.
+ * Default does nothing.
+ */
+ protected def onListenersListEmptied() {
+ }
+
+ /**
* Update the listeners with the message generated by createUpdate
*/
protected def updateListeners() {

0 comments on commit ddf1cb8

Please sign in to comment.