Class NativeRuntime

java.lang.Object
dev.vortex.jni.NativeRuntime

public final class NativeRuntime extends Object
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 Details

    • setWorkerThreads

      public static void setWorkerThreads(int n)
      Set the number of background worker threads driving Vortex futures. 0 disables background execution; any positive value adjusts the pool up or down.
    • setWorkerThreadsToAvailableParallelism

      public static void setWorkerThreadsToAvailableParallelism()
      Size the pool to Runtime.getRuntime().availableProcessors() - 1.
    • workerCount

      public static int workerCount()
      Returns the current background worker-thread count.