J
Jan Burse
Dear All,
I am just wondering whether a Go programming
language construct can be done in Java by
means of some standard packages.
The Go programming language construct, is the
switch statement over channels:
switch {
c <- channel1:
/* do something 1 */
c <- channel2:
/* do something 2 */
}
I interpret this that the code will try to fetch
data from channel1 and channel2, and depending on
which channel has fist some data, the corresponding
code will be executed?
How could this be done in Java? I have the feeling
that read() does not work since it blocks, and that
available() would not work since it would involve
polling. So something else could solve the problem...
Best Regards
I am just wondering whether a Go programming
language construct can be done in Java by
means of some standard packages.
The Go programming language construct, is the
switch statement over channels:
switch {
c <- channel1:
/* do something 1 */
c <- channel2:
/* do something 2 */
}
I interpret this that the code will try to fetch
data from channel1 and channel2, and depending on
which channel has fist some data, the corresponding
code will be executed?
How could this be done in Java? I have the feeling
that read() does not work since it blocks, and that
available() would not work since it would involve
polling. So something else could solve the problem...
Best Regards