aviatorscript icon indicating copy to clipboard operation
aviatorscript copied to clipboard

编译后的expression 外部缓存支持

Open NineBK opened this issue 2 years ago • 3 comments

编译后的expression缓存在外部环境中,比如说redis(尝试过,但是无法序列化为Expression)。如果服务多实例部署,缓存在本地是否存在一致性问题

NineBK avatar Mar 14 '22 05:03 NineBK

自己做数据一致性保证吧

hillfly avatar Mar 15 '22 07:03 hillfly

我同样有此问题,能详细说下吗 @hillfly

zhang13690 avatar Mar 15 '22 08:03 zhang13690

有空我测试下 redis,按理说应该可以

killme2008 avatar Mar 25 '22 08:03 killme2008

@killme2008 看上去expression没有实现java的序列化接口,不能缓存到外部环境中。

lanjiancheng avatar Sep 30 '22 03:09 lanjiancheng

5.4.0 released, ship serialization feature for compiled expression.

See the test case for usage:

https://github.com/killme2008/aviatorscript/blob/master/src/test/java/com/googlecode/aviator/ExpressionSerializeTest.java

The Option.SERIALIZABLE must be enabled.

killme2008 avatar Oct 03 '23 10:10 killme2008

The example

https://github.com/killme2008/aviatorscript/blob/master/src/test/java/com/googlecode/aviator/example/SerializeExample.java

killme2008 avatar Oct 03 '23 11:10 killme2008