com.dropchop.quarkus.snakejar.SnakeJarInvokersConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-snakejar Show documentation
Show all versions of quarkus-snakejar Show documentation
Quarkus extension that integrates SnakeJar Java library with embedded CPython to Quarkus.
This extension enables calling Python native code from Quarkus REST services.
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