Skip to content

Instantly share code, notes, and snippets.

@chefhoobajoob
chefhoobajoob / AddingVerticle.js
Last active September 23, 2018 21:16
Possible solution to protecting module global data in js verticles from MT access
/* global vertx */
var logger = org.slf4j.LoggerFactory.getLogger('vertx.tests.AddingVerticle');
module.exports = {
vertxStartAsync: function (startFuture) {
logger.info('verticle started');
vertx.executeBlocking(function (blockingFuture) {
logger.debug('requiring dependency');
var adder = require('./onePlusOne');
@chefhoobajoob
chefhoobajoob / HealthCheck.js
Last active July 31, 2017 15:39
Reproducer for vertx-health-check-js error when completing futures with status
module.exports = {
vertxStartAsync: function (startFuture) {
vertx.executeBlocking(function (blockingFuture) {
try {
var Router = require("vertx-web-js/router");
var router = Router.router(vertx);
var handler = require("vertx-health-checks-js/health_check_handler").create(vertx);
handler.register("complete-with-ok", function (future) {
@chefhoobajoob
chefhoobajoob / TestClient.java
Created May 25, 2017 13:45
Reproducer for vertx-unit issue 49 Can't reproduce the behavior with this test.
package vertxunit.tests;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
apply plugin: 'com.moowork.node'
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
@chefhoobajoob
chefhoobajoob / debug.txt
Last active December 3, 2015 13:08
Results of running vagrant up in debug mode for issue 6635
vagrant.exe : INFO global: Vagrant version: 1.7.4At line:1 char:1
+ vagrant --debug up 1> debug.txt 2>&1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( INFO global: Vagrant version: 1.7.4:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.7.4\\bin\\vagrant"
@chefhoobajoob
chefhoobajoob / RetryWhenRetriesRootObservable.java
Last active October 27, 2015 21:58
This gist provides a JUnit test showing that retryWhen() does not retry its immediate parent Observable, but instead retries the root observable in the chain.
package ot.publishing.vertx.service.publisher.tests;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.*;
import org.junit.Test;
import rx.Observable;
public class RetryWhenRetriesRootObservable {