Skip to content

Instantly share code, notes, and snippets.

public class Server {
public static void main(String[] args) {
try {
Executor pool = Executors.newCachedThreadPool();
ChannelFactory factory =
new NioServerSocketChannelFactory(
pool,
test {
classpath 'build/classes/main'
systemProperty 'vertx.test.timeout', 15
systemProperty 'vertx.mods', "$projectDir/build/tmp/mod-test"
systemProperty 'vertx.version', "$project.version"
testLogging.showStandardStreams = true
}
Gives error:
/*
* Copyright 2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@purplefox
purplefox / gist:4119186
Created November 20, 2012 16:49
Jython Mem leaks
private void cleanUpJythonMess() {
try {
//Jython stores a reference to the system state on a thread local, when the system state is closed
//Jython does not remove the TL so... hey presto a leak
//The only way we can remove it is to use reflection to manually remove the tl entry
//Nice huh!?
//See https://github.com/vert-x/vert.x/issues/417 for more info
//Also http://bugs.jython.org/issue1327
tim $ java -cp ./classes:. kilim.examples.Chain 10
Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 68 in method kilim.Task.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;Lkilim/Fiber;)Ljava/lang/Object; at offset 16
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
at java.lang.Class.getMethod0(Class.java:2685)
at java.lang.Class.getMethod(Class.java:1620)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:484)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:476)
No daemon-
tim $ time ./mk vertx-testsuite:test -Dtest.single=JavaScriptIncludeTest
:vertx-core:compileJava UP-TO-DATE
:vertx-core:processResources UP-TO-DATE
:vertx-core:classes UP-TO-DATE
:vertx-core:jar UP-TO-DATE
:vertx-platform:compileJava
:vertx-platform:processResources UP-TO-DATE
:vertx-platform:classes
module ModA
class SomeClass
end
end
Module.new do
module ModA
class SomeClass
end
end
module ModB
require "vertx"
Vertx::EventBus.register_handler('test.address') do |message|
puts "Executing on thread #{java.lang.Thread.currentThread}"
100.times do |i|
puts "count is #{i}"
end
end
require "vertx"
Vertx.deploy_verticle('concurrent.rb', nil, 10)
msg = {
"foo" => "bar",
"quux" => "wibble"
}
Vertx.set_periodic(1) {