Skip to content

Instantly share code, notes, and snippets.

65E8 59E4 DB40 5A41

Paulo Lopes pmlopes

65E8 59E4 DB40 5A41
View GitHub Profile
View gist:bfeeb39a304993501f24394a4760c05b
Unhandled exception caused by org.graalvm.polyglot.PolyglotException: java.lang.AssertionError: Invalid libray usage. Cached library must be adopted by a RootNode before it is executed.
at org.graalvm.truffle/$DynamicDispatchLibraryExports$Cached.dispatch(
at org.graalvm.truffle/$Asserts.accepts(
at org.graalvm.truffle/
at org.graalvm.truffle/$SingleMappingNode.doDefault(
at org.graalvm.truffle/$SingleMappingNodeGen.execute(
at org.graalvm.truffle/$TargetMappingType.execute(
package io.vertx.benchmark;
import io.reactiverse.pgclient.*;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpServerRequest;
import io.vertx.core.json.*;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
View index.js
/// <reference types="@vertx/core/runtime" />
// @ts-check
const util = require('util');
import {Router} from '@vertx/web';
import {PgClient, Tuple} from '@reactiverse/reactive-pg-client';
import {PgPoolOptions} from '@reactiverse/reactive-pg-client/options';
const SELECT_WORLD = "SELECT id, randomnumber from WORLD where id=$1";
View vertx-eventbus.js
* Copyright (c) 2011-2015 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
* The Eclipse Public License is available at
pmlopes /
Created Jun 27, 2018
Graal JS Overload issue
public interface Handler<T> {
void handle(T value);
pmlopes /
Created Mar 20, 2017
How to consume a Oauth2 project API with Vert.x
// setup an Oauth2 provider for Keycloak
OAuth2Auth oauth2 = KeycloakAuth.create(vertx, OAuth2FlowType.PASSWORD, config());
// credentials
JsonObject credentials = new JsonObject()
.put("username", username)
.put("password", password);
// create an WebClient to make request
final WebClient client = WebClient.create(vertx);
pmlopes / test.html
Created Jan 5, 2016
amp gallery experiment
View test.html
<!doctype html>
<html >
<meta charset="utf-8">
<title>AMP #0</title>
<link rel="canonical" href="amps.html" >
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<link href='' rel='stylesheet' type='text/css'>
<style amp-custom>
body {
pmlopes / pom.xml
Created Oct 9, 2015
Release Vert.x 3.x with support from git-flow
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""
pmlopes / settings.xml
Created Sep 10, 2015
Use sonatype snapshots in your local maven
View settings.xml
pmlopes /
Created Jul 10, 2015
package vert.x stacks for npm

Vert.x 3 Minimal stack

Vert.x3 + the endorsed modules


  • Vert.x Core
  • Groovy, JS and Ruby languages
  • Hazelcast clustering
  • Service proxy