Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

java.util.concurrent doesn't have a convenient mechanism for "selecting" across available channels/queues without blocking. This is a key feature of erlang and go. There are ways to simulate it, but it's not the same thing. (I'd love to be wrong about this).


Yes, you need to peek() the queues, so it is not really being blocked on select like Go.

But then, one can use something like Akka, which I forgot to mention, and still be on the JVM.


>so it is not really being blocked on select like Go.

Select in Go only blocks if you don't feel out the "default:" case...

  select {
     case: foo := <-fooCh
       fmt.Printf("got %v\n", foo)
     default:
       fmt.Println("got nothing")
  }




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: