Skip to content

Instantly share code, notes, and snippets.

@ryanlecompte
Created January 19, 2013 16:29
Show Gist options
  • Save ryanlecompte/4573499 to your computer and use it in GitHub Desktop.
Save ryanlecompte/4573499 to your computer and use it in GitHub Desktop.
silly jetty BlockingArrayQueue doesn't block!
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