Skip to content

Instantly share code, notes, and snippets.

View vietj's full-sized avatar
🤖
Coding the Future

Julien Viet vietj

🤖
Coding the Future
View GitHub Profile
@Test
public void testCloseHandlerWhenConnectionEnds() throws Exception {
server.requestHandler(req -> {
req.response().closeHandler(v -> {
testComplete();
});
req.response().setChunked(true).write("some-data");
});
startServer(testAddress);
client.request(HttpMethod.GET, testAddress, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/somepath", resp -> {
@vietj
vietj / 4m1.md
Last active July 26, 2019 07:48
title date template author draft
Eclipse Vert.x 4 milestone 1 released!
2019-07-26
post.html
vietj
false

We are extremely pleased to announce the first 4.0 milestone release of Eclipse Vert.x .

Tests run: 5, Failures: 5, Errors: 0, Skipped: 0, Time elapsed: 2.149 sec <<< FAILURE! - in io.vertx.pgclient.data.TsTypesExtendedCodecTest
test_tsquery_and_tsvector(io.vertx.pgclient.data.TsTypesExtendedCodecTest) Time elapsed: 0.017 sec <<< FAILURE!
junit.framework.AssertionFailedError: Expected that public abstract java.lang.Boolean io.vertx.sqlclient.Tuple.getBoolean(int) would not fail: expected:<true> but was:<false>
at io.vertx.pgclient.data.ColumnChecker.lambda$returns$0(ColumnChecker.java:180)
at io.vertx.pgclient.data.ColumnChecker.forRow(ColumnChecker.java:284)
at io.vertx.pgclient.data.TsTypesExtendedCodecTest.lambda$null$0(TsTypesExtendedCodecTest.java:27)
test_tsquery_array(io.vertx.pgclient.data.TsTypesExtendedCodecTest) Time elapsed: 0.032 sec <<< FAILURE!
org.junit.internal.ArrayComparisonFailure: Expected that public abstract java.lang.String[] io.vertx.sqlclient.Tuple.getStringArray(int) returns ['fat':AB & 'cat', 'super':*] instead of ['fat':AB & 'cats', 'super':*]: arrays first di
package io.vertx.mysqlclient;
import io.vertx.sqlclient.Row;
import io.vertx.sqlclient.Tuple;
import java.util.function.BiConsumer;
import java.util.function.Function;
public class Main {

BBQ fin d'année

20 personnes.

Saucisses (Nico)

  • 35 mergez et 35 saucisses de chez El Tayeb

Pain (Joel)

private static int branchless1(byte c) {
// 48 == 11 0000
// 49 == 11 0001
// 50 == 11 0010
// 57 == 11 1001
byte b1 = (byte) ((c & 0b0001_0000) >> 4);
byte b2 = (byte) ((c & 0b0010_0000) >> 5);
byte b3 = (byte) ((c & 0b0100_0000) >> 6);
byte b4 = (byte) ((c & 0b1000_0000) >> 7);
byte b5 = (byte) (b1 & b2 & ~b3 & ~b4);
private static int indexOf(byte c) {
if (c == '-') {
return 26;
} else if (c >= '0' && c <= '9') {
return c;
} else if (c >= 'A' && c <= 'Z') {
return c - 'A';
} else if (c >= 'a' && c <= 'z') {
return c - 'a';
} else {
public Scope receiveRequest(Map<Object, Object> context, Object request, String operation, Iterable<Map.Entry<String, String>> headers, Iterable<Map.Entry<String, String>> tags) {
SpanContext sc = tracer.extract(Format.Builtin.HTTP_HEADERS, new TextMap() {
@Override
public Iterator<Map.Entry<String, String>> iterator() {
return headers.iterator();
}
@Override
public void put(String key, String value) {
throw new UnsupportedOperationException();
}

Streams

There are several objects in Vert.x that allow items to be read from and written.

In previous versions the io.vertx.core.streams package was manipulating Buffer objects exclusively. From now, streams are not coupled to buffers anymore and they work with any kind of objects.

In Vert.x, write calls return immediately, and writes are queued internally.

package io.vertx.tracing.jaeger;
import io.jaegertracing.internal.JaegerSpanContext;
import io.opentracing.Scope;
import io.opentracing.Span;
import io.opentracing.SpanContext;
import io.opentracing.Tracer;
import io.opentracing.propagation.Format;
import io.opentracing.propagation.TextMap;
import io.opentracing.tag.Tags;