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
package foo; | |
import co.paralleluniverse.fibers.*; | |
import co.paralleluniverse.strands.*; | |
import co.paralleluniverse.strands.channels.*; | |
import static co.paralleluniverse.strands.channels.Channels.*; | |
public class quasarwhispers { | |
static SuspendableRunnable whisper(LongChannel left, LongChannel right) { | |
return () -> { right.send(left.receive() + 1); } | |
} |
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
package foo; | |
import co.paralleluniverse.fibers.*; | |
import co.paralleluniverse.strands.*; | |
import co.paralleluniverse.strands.channels.*; | |
import static co.paralleluniverse.strands.channels.Channels.*; | |
public class quasarwhispers { | |
static void quasarWhispers(int n) throws Exception { | |
LongChannel leftmost = newLongChannel(0); | |
LongChannel left = leftmost, right = leftmost; |