Package io.higson.runtime.invoker
Class PythonFunctionInvoker
java.lang.Object
io.higson.runtime.invoker.PythonFunctionInvoker
- All Implemented Interfaces:
FunctionInvoker
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddGlobalObject(FunctionCode code, Object obj) call(PythonFunction function, Object[] args) static PythonFunctionInvokerdefaultInvoker(FunctionLoggerCreator functionLoggerCreator) voidinvalidate(int implId) Invoke function, it is a good practice to wrap any outgoing exceptions withSmartParamExceptionwith FUNCTION_INVOKE_ERROR reason.static PythonFunctionInvokerinvokerWithExtraModules(List<String> module, FunctionLoggerCreator functionLoggerCreator) Create python function invoker with support of external packages or modules.
-
Method Details
-
defaultInvoker
- Parameters:
functionLoggerCreator- functionLoggerCreator- Returns:
- default invoker with basic python language support, without any external modules
-
invokerWithExtraModules
public static PythonFunctionInvoker invokerWithExtraModules(List<String> module, FunctionLoggerCreator functionLoggerCreator) Create python function invoker with support of external packages or modules. Example:padasornumpy- Parameters:
module- list of modules to add, if null provided, then nothing bad happens- Returns:
- ready to ues function invoker
-
invoke
Description copied from interface:FunctionInvokerInvoke function, it is a good practice to wrap any outgoing exceptions withSmartParamExceptionwith FUNCTION_INVOKE_ERROR reason.- Specified by:
invokein interfaceFunctionInvoker- Parameters:
function- description of function to invokeargs- arguments- Returns:
- evaluated value (can be null)
-
call
- Throws:
jep.JepException
-
invalidate
public void invalidate(int implId) -
addGlobalObject
-