Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Paulo Lopes pmlopes

💭
I may be slow to respond.
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/com.oracle.truffle.api.object.DynamicObjectGen$DynamicDispatchLibraryExports$Cached.dispatch(DynamicObjectGen.java:154)
at com.oracle.truffle.js.runtime.builtins.JSClassGen$InteropLibraryExports$Cached.accepts(JSClassGen.java:119)
at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary$Asserts.accepts(InteropLibrary.java:1594)
at org.graalvm.truffle/com.oracle.truffle.polyglot.ToHostNodeGen.execute(ToHostNodeGen.java:45)
at org.graalvm.truffle/com.oracle.truffle.polyglot.TargetMappingNode$SingleMappingNode.doDefault(TargetMappingNode.java:145)
at org.graalvm.truffle/com.oracle.truffle.polyglot.TargetMappingNodeGen$SingleMappingNodeGen.execute(TargetMappingNodeGen.java:159)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode$TargetMappingType.execute(HostExecuteNode.java
View App.java
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
* http://www.eclipse.org/legal/epl-v10.html
*
@pmlopes
pmlopes / Handler.java
Created Jun 27, 2018
Graal JS Overload issue
View Handler.java
@FunctionalInterface
public interface Handler<T> {
void handle(T value);
}
@pmlopes
pmlopes / VertxOauth2Client.java
Created Mar 20, 2017
How to consume a Oauth2 project API with Vert.x
View VertxOauth2Client.java
// 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
pmlopes / test.html
Created Jan 5, 2016
amp gallery experiment
View test.html
<!doctype html>
<html >
<head>
<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='https://fonts.googleapis.com/css?family=Questrial' rel='stylesheet' type='text/css'>
<style amp-custom>
body {
@pmlopes
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="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.vertx</groupId>
<artifactId>vertx-release</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
@pmlopes
pmlopes / settings.xml
Created Sep 10, 2015
Use sonatype snapshots in your local maven
View settings.xml
<settings>
<profiles>
<profile>
<id>allow-snapshots</id>
<activation><activeByDefault>true</activeByDefault></activation>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
@pmlopes
pmlopes / README.md
Created Jul 10, 2015
package vert.x stacks for npm
View README.md

Vert.x 3 Minimal stack

Vert.x3 + the endorsed modules

Contents

  • Vert.x Core
  • Groovy, JS and Ruby languages
  • Hazelcast clustering
  • Service proxy
You can’t perform that action at this time.