All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dropchop.quarkus.snakejar.SnakeJarInvokersConfig Maven / Gradle / Ivy

Go to download

Quarkus extension that integrates SnakeJar Java library with embedded CPython to Quarkus. This extension enables calling Python native code from Quarkus REST services.

There is a newer version: 1.35.7
Show newest version
package com.dropchop.quarkus.snakejar;

import io.quarkus.runtime.annotations.*;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithParentName;

import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
 * @author Nikola Ivačič  on 6. 11. 21.
 */
@ConfigMapping(prefix = "quarkus.snakejar")
@ConfigRoot(phase = ConfigPhase.RUN_TIME)
public interface SnakeJarInvokersConfig {

  /**
   * Log level configuration for JNI c library
   */
  @WithDefault("error")
  String logLevel();

  /**
   * SnakeJar implementation class
   */
  @WithDefault("com.dropchop.snakejar.impl.SnakeJarEmbedded")
  String className();

  /**
   * Number of always present threads in Invoker thread pool
   */
  @WithDefault("1")
  int coreThreads();

  /**
   * Maximum number of threads in Invoker thread pool
   */
  @WithDefault("1")
  int maxThreads();

  /**
   * Name of the thread pool for Invokers to run.
   */
  Optional threadPoolName();


  interface SnakeJarInvokerConfig {

    /**
     * Order for module compilation
     */
    Optional> moduleOrder();

    /**
     * Configuration for python modules
     */
    @ConfigDocMapKey("module-name")
    @ConfigDocSection
    Map modules();

    /**
     * Configuration for python module
     */
    @ConfigGroup
    interface Module {

      /**
       * Configuration for python module source
       */
      String source();
    }
  }


  /**
   * The default SnakeJar invoker.
   */
  @WithParentName
  SnakeJarInvokerConfig defaultInvoker();

  /**
   * Additional named SnakeJar invokers.
   */
  @ConfigDocSection
  @ConfigDocMapKey("invoker-name")
  @WithParentName
  Map namedInvokers();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy