dispose references removed

This commit is contained in:
bojancrevar
2025-09-12 15:25:02 +02:00
parent 23898b5a25
commit 740b0fd0bc
5 changed files with 2 additions and 19 deletions
+1
View File
@@ -1,4 +1,5 @@
.DS_Store
.temp
/target
/Cargo.lock
-2
View File
@@ -40,7 +40,6 @@ import fs from 'fs/promises';
const decision = engine.createDecision(content);
const result = await decision.evaluate({ input: 15 });
engine.dispose();
})();
```
@@ -59,7 +58,6 @@ const loader = async (key: string) => fs.readFile(path.join(testDataRoot, key))(
const engine = new ZenEngine({ loader });
const result = await engine.evaluate('jdm_graph1.json', { input: 5 });
engine.dispose();
})();
```
-12
View File
@@ -225,16 +225,4 @@ impl ZenEngine {
self.get_decision(key).await.into()
}
// Function used to dispose memory allocated for loaders
// In the future, it will likely be removed and made automatic
// #[napi]
// pub fn dispose(&self) {
// if let Some(loader) = self.loader_ref {
// let _ = loader.abort();
// }
//
// if let Some(loader) = self.custom_handler_ref {
// let _ = loader.abort();
// }
// }
}
+1 -1
View File
@@ -34,7 +34,7 @@ where
}
}
Object::to_napi_value(env, obj) //TODO BC ?
Object::to_napi_value(env, obj)
}
}
-4
View File
@@ -31,7 +31,6 @@ describe('ZenEngine', () => {
expect(r2.result.output).toEqual(0);
expect(r3.result.output).toEqual(10);
// engine.dispose();
}, 10000);
it('Evaluates decisions using getDecision', async () => {
@@ -50,7 +49,6 @@ describe('ZenEngine', () => {
expect(r2.result.output).toEqual(0);
expect(r3.result.output).toEqual(10);
// engine.dispose();
}, 10000);
it('Creates a decision from contents', async () => {
@@ -86,7 +84,6 @@ describe('ZenEngine', () => {
const r = await engine.evaluate('custom.json', { a: 5 });
expect(r.result.data).toEqual(25);
// engine.dispose();
});
it('Parses ZenDecisionContent', async () => {
@@ -134,7 +131,6 @@ describe('ZenEngine', () => {
}
}
// engine.dispose();
});
});