mirror of
https://github.com/gorules/zen.git
synced 2026-10-04 08:02:28 +00:00
feat: precompile decision content (#401)
* precompile first * test * add Opcode cache through Option<T> * Compiled support for decisionTable, default compile of new DecisionContent for node.js and py bindings * format * DecisionContent refactored to model module * fmt * added back BaseDecisionContent * tests and benchmark --------- Co-authored-by: Stefan <stefan@gorules.io>
This commit is contained in:
co-authored by
Stefan
parent
611b489e49
commit
7bfebd90fe
@@ -14,7 +14,9 @@ pub struct PyZenDecisionContent(pub Arc<DecisionContent>);
|
||||
impl PyZenDecisionContent {
|
||||
#[new]
|
||||
pub fn new(data: &str) -> PyResult<Self> {
|
||||
let content = serde_json::from_str(data).context("Failed to parse JSON")?;
|
||||
let mut content: DecisionContent =
|
||||
serde_json::from_str(data).context("Failed to parse JSON")?;
|
||||
content.compile();
|
||||
Ok(Self(Arc::new(content)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user