Closed hsluoyz closed 6 years ago
BTW, I'm using this library in: https://github.com/casbin/jcasbin, an access control library for Java
@hsluoyz Yep, the aviator evaluator is a global instance,it's not a good practice for some usages.I think it's a good idea to provide evaluator instances for different usages.
4.0.0-RC released, and it supports multi AviatorEvaluatorInstance
.
You can create a instance by:
AviatorEvaluatorInstance instance = AviatorEvaluator.newInstance();
instance.exec(......)
And every instance has it's own options,custom functions and operators.
https://github.com/killme2008/aviator/releases/tag/aviator-4.0.0-RC
I want to use aviator in a multi-threading environment. Each thread uses aviator to evaluate expressions. But the
AviatorEvaluator.addFunction()
is a static method. So it is global and will influence all threads. But I only want each thread to specify its own functions. Can you makeaddFunction()
a local method, like an instance method?