diff --git a/src/main/java/org/vertx/java/core/impl/DefaultVertx.java b/src/main/java/org/vertx/java/core/impl/DefaultVertx.java index 4911c3530cc..91bb35a822c 100644 --- a/src/main/java/org/vertx/java/core/impl/DefaultVertx.java +++ b/src/main/java/org/vertx/java/core/impl/DefaultVertx.java @@ -63,11 +63,10 @@ public class DefaultVertx extends VertxInternal { private final EventBus eventBus; private final SharedData sharedData = new SharedData(); - private int backgroundPoolSize = 1; + private int backgroundPoolSize = 20; private int corePoolSize = Runtime.getRuntime().availableProcessors(); private ExecutorService backgroundPool; private OrderedExecutorFactory orderedFact; - private ExecutorService corePool; private NioWorkerPool workerPool; private ExecutorService acceptorPool; private final Map sharedHttpServers = new HashMap<>(); @@ -139,14 +138,6 @@ public Context startInBackground(final Runnable runnable) { return context; } - private void runOnContext(final Context context, final Runnable runnable) { - context.execute(new Runnable() { - public void run() { - runnable.run(); - } - }); - } - public boolean isEventLoop() { Context context = Context.getContext(); if (context != null) { @@ -203,7 +194,7 @@ public NioWorkerPool getWorkerPool() { synchronized (this) { result = workerPool; if (result == null) { - corePool = Executors.newFixedThreadPool(corePoolSize, new VertxThreadFactory("vert.x-core-thread-")); + ExecutorService corePool = Executors.newFixedThreadPool(corePoolSize, new VertxThreadFactory("vert.x-core-thread-")); workerPool = result = new NioWorkerPool(corePool, corePoolSize, false); } } @@ -254,6 +245,14 @@ public Map sharedNetServers() { return sharedNetServers; } + private void runOnContext(final Context context, final Runnable runnable) { + context.execute(new Runnable() { + public void run() { + runnable.run(); + } + }); + } + private long setTimeout(final long delay, boolean periodic, final Handler handler) { final Context context = getOrAssignContext(); diff --git a/src/tests/javascript/busmods/worker/test_worker.js b/src/tests/javascript/busmods/worker/test_worker.js index d24c4a4277c..47e0676650f 100644 --- a/src/tests/javascript/busmods/worker/test_worker.js +++ b/src/tests/javascript/busmods/worker/test_worker.js @@ -61,6 +61,5 @@ tu.appReady(); function vertxStop() { vertx.eventBus.unregisterHandler('testWorker', handler); - tu.checkContext(); tu.appStopped(); } diff --git a/src/tests/javascript/busmods/workqueue/order_processor.js b/src/tests/javascript/busmods/workqueue/order_processor.js index 0d234aafc48..6f090a6bd9f 100644 --- a/src/tests/javascript/busmods/workqueue/order_processor.js +++ b/src/tests/javascript/busmods/workqueue/order_processor.js @@ -46,7 +46,6 @@ function vertxStop() { processor: id }); eb.unregisterHandler(id, handler); - tu.checkContext(); if (!dontsendAppLifeCycle) { tu.appStopped(); }