Created
January 19, 2013 16:29
-
-
Save ryanlecompte/4573499 to your computer and use it in GitHub Desktop.
silly jetty BlockingArrayQueue doesn't block!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> import org.eclipse.jetty.util.BlockingArrayQueue | |
import org.eclipse.jetty.util.BlockingArrayQueue | |
scala> val q = new BlockingArrayQueue[Int](3) | |
q: org.eclipse.jetty.util.BlockingArrayQueue[Int] = [] | |
scala> q.put(1) | |
scala> q.put(2) | |
scala> q.put(3) | |
scala> try q.put(4) catch { case _ => println("sorry!") } | |
sorry! | |
scala> q.size | |
res12: Int = 3 | |
scala> q.add(4) | |
res13: Boolean = false | |
scala> q.add(5) | |
res14: Boolean = false | |
scala> q.size | |
res15: Int = 3 | |
scala> q.offer(5) | |
res16: Boolean = false | |
scala> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment