Skip to content

Instantly share code, notes, and snippets.

@smaldini
Forked from kadyana/gist:d4c73101a54ffe5afb99
Last active November 11, 2015 00:01
Show Gist options
  • Save smaldini/e5a5e5179055b440eac7 to your computer and use it in GitHub Desktop.
Save smaldini/e5a5e5179055b440eac7 to your computer and use it in GitHub Desktop.
Reactive Client Server with Aeron transport
// AeronProcessor as a server
AeronProcessor server = AeronProcessor.builder()
.senderChannel("udp://localhost:12000")
.receiverChannel("udp://localhost:12001")
.senderOnly(true)
.create();
// Read file bytes on server command
IO.readFile("~/test.txt")
.subscribe(server);
// AeronProcessor as a client
AeronProcessor client = AeronProcessor.builder()
.senderChannel("udp://localhost:12000")
.receiverChannel("udp://localhost:12001")
.receiverOnly(true)
.create();
client.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