Skip to content

Instantly share code, notes, and snippets.

View smaldini's full-sized avatar

Stephane Maldini smaldini

View GitHub Profile
@smaldini
smaldini / Aeron.java
Last active November 11, 2015 00:01 — forked from kadyana/gist:d4c73101a54ffe5afb99
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);
@smaldini
smaldini / sample.java
Last active June 10, 2016 16:44 — forked from jbrisbin/BroadcastStream.java
Scatter gather Async Flux example using #ProjectReactor
// Create an async message-passing Processor exposing a Flux API
TopicProcessor<String> sink = TopicProcessor.create();
// Scatter Gather the input sequence
sink
.map(String::toUpperCase)
.flatMap(s ->
Mono.fromCallable(() -> someRepository.findOneByCategory(s))
.timeout(Duration.ofSeconds(3), someRepository::fallback)
.subscribeOn(Schedulers.parallel())
includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_GrailsTest")
includeTargets << grailsScript("_GrailsWar")
target(main: "Clean, Test, and War") {
clean()
allTests() // results in (1)
//packageApp() not needed
warCreator.configureWarName()
war()