Skip to content

Instantly share code, notes, and snippets.

@kadyana
Last active October 21, 2015 10:42
Show Gist options
  • Save kadyana/d4c73101a54ffe5afb99 to your computer and use it in GitHub Desktop.
Save kadyana/d4c73101a54ffe5afb99 to your computer and use it in GitHub Desktop.
Aeron gist
// AeronProcessor as a server
AeronProcessor processor = AeronProcessor.builder()
.name("server")
.senderChannel("udp://localhost:12000")
.receiverChannel("udp://localhost:12001")
.senderOnly(true)
.create();
Streams.range(1, 1000)
.map(i -> Buffer.wrap("" + i))
.subscribe(processor);
// AeronProcessor as a client
AeronProcessor processor = AeronProcessor.builder()
.name("client")
.senderChannel("udp://localhost:12000")
.receiverChannel("udp://localhost:12001")
.receiverOnly(true)
.create();
processor.subscribe(
Subscribers.unbounded((next, sub) -> System.out.println(next)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment