activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1295354 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
Date Thu, 01 Mar 2012 00:24:21 GMT
Author: chirino
Date: Thu Mar  1 00:24:21 2012
New Revision: 1295354

URL: http://svn.apache.org/viewvc?rev=1295354&view=rev
Log:
Support removing overflow items before they are delivered.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala?rev=1295354&r1=1295353&r2=1295354&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Sink.scala
Thu Mar  1 00:24:21 2012
@@ -126,6 +126,26 @@ class OverflowSink[T](val downstream:Sin
 
   downstream.refiller = ^{ drain }
 
+  def removeFirst = {
+    if( !overflow.isEmpty ) {
+      var rc = overflow.removeFirst()
+      onDelivered(rc)
+      Some(rc)
+    } else {
+      None
+    }
+  }
+
+  def removeLast = {
+    if( !overflow.isEmpty ) {
+      var rc = overflow.removeLast()
+      onDelivered(rc)
+      Some(rc)
+    } else {
+      None
+    }
+  }
+
   protected def drain:Unit = {
     while( overflowed ) {
       if( !downstream.offer(overflow.peekFirst()) ) {



Mime
View raw message