Skip to content

Instantly share code, notes, and snippets.

💭
Coding the Future

Julien Viet vietj

💭
Coding the Future
Block or report user

Report or block vietj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test.java
@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 -> {
View 4m1.md
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 .

View gist:2b5efd6100a0d98f006bdd0b39f635d9
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
View collector.java
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 {
View bbq2019.md

BBQ fin d'année

20 personnes.

Saucisses (Nico)

  • 35 mergez et 35 saucisses de chez El Tayeb

Pain (Joel)

View gist:93e23b2666e8bffc56d6ff100f171035
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);
View gist:8487068daddfb521c6b954a5aee84e65
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 {
View test.java
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();
}
View streams.adoc

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.

View tracing-test.java
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;
You can’t perform that action at this time.