This file contains 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
#this goes into .ebextensions-Folder | |
files: | |
"/var/app/current/.env.local" : | |
mode: "000644" | |
owner: root | |
group: root | |
content: | | |
NO_SUCH_KEY=NO_SUCH_VALUE | |
container_commands: |
This file contains 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
import com.hazelcast.core.Hazelcast; | |
import io.vertx.core.Promise; | |
import io.vertx.core.Vertx; | |
import io.vertx.core.VertxOptions; | |
import io.vertx.core.eventbus.MessageConsumer; | |
import io.vertx.spi.cluster.hazelcast.HazelcastClusterManager; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
/** |
This file contains 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
JMX_IP=$(curl http://169.254.169.254/latest/meta-data/public-ipv4) | |
exec java $JAVA_OPTS -Djava.rmi.server.hostname=$JMX_IP -jar app.jar $JAVA_ARGS |
This file contains 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
#!/bin/bash | |
set -e | |
now=$(date +"%Y-%m-%d_%H-%M-%S") | |
tag="./target/app-$now.zip" | |
mvn clean install | |
echo "web: ./run.sh" > target/Procfile | |
echo "JMX_IP=\$(curl http://169.254.169.254/latest/meta-data/public-ipv4)" > target/run.sh | |
echo "exec java \$JAVA_OPTS -Djava.rmi.server.hostname=\$JMX_IP -jar app.jar \$JAVA_ARGS" >> target/run.sh | |
chmod +x target/run.sh | |
zip -j ${tag} target/Procfile target/run.sh target/app.jar |
This file contains 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
#!/bin/bash | |
set -e | |
now=$(date +"%Y-%m-%d_%H-%M-%S") | |
tag="./target/app-$now.zip" | |
mvn clean install | |
echo "web: ./run.sh" > target/Procfile | |
echo "JMX_IP=\$(curl http://169.254.169.254/latest/meta-data/public-ipv4)" > target/run.sh | |
echo "exec java \$JAVA_OPTS -Djava.rmi.server.hostname=\$JMX_IP -jar app.jar \$JAVA_ARGS" >> target/run.sh | |
chmod +x target/run.sh | |
zip -j ${tag} target/Procfile target/run.sh target/app.jar |
This file contains 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
import java.util.List; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.function.Function; | |
import java.util.stream.Collector; | |
import java.util.stream.Collectors; | |
public class CompletableFutureCollector2 { | |
private CompletableFutureCollector2(){ | |
} |
This file contains 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
public static void main(String[] args) { | |
CompletableFuture<List<Integer>> collect = Stream.of(1,2,3).map(CompletableFuture::completedFuture).collect(CompletableFutureCollector.allOf()); | |
} |
This file contains 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
static<T> CompletableFuture<List<T>> sequence(List<CompletableFuture<T>> com) { | |
return CompletableFuture.allOf(com.toArray(new CompletableFuture[com.size()])) | |
.thenApply(v -> com.stream() | |
.map(CompletableFuture::join) | |
.collect(toList()) | |
); | |
} |
This file contains 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
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Set; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.function.BiConsumer; | |
import java.util.function.BinaryOperator; | |
import java.util.function.Function; | |
import java.util.function.Supplier; | |
import java.util.stream.Collector; |
This file contains 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
public class SomeJsonTest { | |
public void getJsonFromRecord2(){ | |
SomethingDao somethingDao = new SomethingDao(); | |
CompletableFuture<JsonObject> jsonFuture = somethingDao.executeAsync(dslContext -> dslContext | |
.select(Tables.SOMETHING.SOMEID) | |
.select(Tables.SOMEOTHERTHING.SOMEVALUE) | |
.join(Tables.SOMEOTHERTHING) | |
.on(Tables.SOMETHING.SOMEID.eq(Tables.SOMEOTHERTHING.SOMEOTHERID)) | |
.where(Tables.SOMETHING.SOMEID.eq(1)) |
NewerOlder