Package dev.vortex.jni
Class NativeRuntime
java.lang.Object
dev.vortex.jni.NativeRuntime
Controls for the JVM-wide current-thread worker pool that backs every Vortex session.
By default the pool has zero background threads: nothing happens until a Java thread calls a blocking Vortex API.
Adding workers via setWorkerThreads(int) lets the pool drive Vortex futures on behalf of the caller — useful
when a single consumer thread cannot keep the executor busy on its own. Spawning Java threads that each poll a
thread-safe Vortex iterator is an equivalent alternative.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidsetWorkerThreads(int n) Set the number of background worker threads driving Vortex futures.static voidSize the pool toRuntime.getRuntime().availableProcessors() - 1.static intReturns the current background worker-thread count.
-
Method Details
-
setWorkerThreads
public static void setWorkerThreads(int n) Set the number of background worker threads driving Vortex futures.0disables background execution; any positive value adjusts the pool up or down. -
setWorkerThreadsToAvailableParallelism
public static void setWorkerThreadsToAvailableParallelism()Size the pool toRuntime.getRuntime().availableProcessors() - 1. -
workerCount
public static int workerCount()Returns the current background worker-thread count.
-