Comments (9)
let i = 0
setInterval(() => {
i++;
if (i>5){
process.exit()
}
}, 1000);
In the current situation, even if nodeRuntime is closed and the await call has exited, the code will continue to run.
from javet.
That's the nature of Node.js. If you run the same code in Node.js, it keeps running as well.
from javet.
Understand, Java applications are usually executed in a single process, while NodeJS is multi-process
from javet.
The following API has been added to address this issue. I believe it will resolve the issue you met. Please wait for the next release and let me know if you have any questions.
NodeRuntime.isStopping()
NodeRuntime.setStopping()
from javet.
I'm not sure why the previous setPurgeEventLoopBeforeClose
was deleted. If it's because multiple NodeRuntimes share a single node event loop, then this method may not solve the fundamental problem. I'm worried that the remaining events may continue to run in other NodeRuntimes.
My current solution is to get all ids by modifying the setTimeout
related functions, and finally clear them all when closing the NodeRuntime
from javet.
It was a complete redesign in Javet, so that API was removed as part of the old design.
Just try the snapshot one. The event loop is skipped completely.
from javet.
Great, that's definitely a better way
from javet.
There is another problem I am currently facing. After creating an es module, I want to set some content on import.meta
, but I have no way to get this object
from javet.
Please create another issue with detailed info, or ping me at discord.
from javet.
Related Issues (20)
- 是否支持配置console.log的打印输出? HOT 2
- Interactive Java[Urgent] HOT 20
- 如果获取异步函数Promise返回结果? HOT 1
- Module imports not working HOT 5
- 在JavaScript中实例化后,怎么在java代码中通过这个对象的名字获取这个实例化的对象 HOT 3
- Execution under thread pool does not meet expectations HOT 1
- Module Enhancement HOT 3
- inject java obj to v8 HOT 7
- The module always returns undefined HOT 1
- Inheritance of Java classes HOT 1
- Performance issues HOT 5
- Module cache error HOT 2
- Nodejs ConsoleArgument '--experimental-vm-modules' invalid HOT 7
- maven module separation HOT 3
- Why can't we determine the primitive type first? HOT 3
- Issue with converter plugins using JavetJVMInterceptor HOT 1
- How to call java Class from javascript without preinjection ? HOT 3
- Issue with calling java function with String[] param from javascript HOT 1
- Lambda object support? HOT 5
- Delete working directory error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javet.