Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于和java对象交互 #360

Open
hanChao-IsBigPenisBoy opened this issue Jul 1, 2024 · 6 comments
Open

关于和java对象交互 #360

hanChao-IsBigPenisBoy opened this issue Jul 1, 2024 · 6 comments

Comments

@hanChao-IsBigPenisBoy
Copy link

我发现在给出的文档中有一个对象JavetReflectionObjectFactory是在包里面不存在的,我的版本已经更新到文档的指定版本,但是还没有这个包,可以指导一下这个包在哪吗

@caoccao
Copy link
Owner

caoccao commented Jul 1, 2024

Clone this project and it's in the source code.

@hanChao-IsBigPenisBoy
Copy link
Author

抱歉我还想问一个愚蠢的问题,比如我在js代码中写一个while(true),我发现java代码就在这块阻塞了,没办法执行下面关闭的代码,如果我想手动停止这段js代码,应该怎么操作, 我写了一个子线程用来跑关闭的代码,结果不太行,并没有达到预期的效果,可以知道一下吗,下面这是我代码
1719914920021

@caoccao
Copy link
Owner

caoccao commented Jul 2, 2024

Please review the doc.

@hanChao-IsBigPenisBoy
Copy link
Author

您不会说的是v8Runtime.terminateExecution(); 主动抛出异常来终止吧

@hanChao-IsBigPenisBoy
Copy link
Author

如果是通过v8Runtime.terminateExecution(); 关闭掉这个进程,可以手动在打开吗,我看通过iJavetEngine.getGuard(10000)自动关闭的可以再打开,手动的这个可以吗

@AsyncProxy
Copy link

抱歉我还想问一个愚蠢的问题,比如我在js代码中写一个while(true),我发现java代码就在这块阻塞了,没办法执行下面关闭的代码,如果我想手动停止这段js代码,应该怎么操作, 我写了一个子线程用来跑关闭的代码,结果不太行,并没有达到预期的效果,可以知道一下吗,下面这是我代码 1719914920021

If you write a Java thread in JS, then the thread will indeed run, but you must know that the main thread of the event loop is still running, so the main thread will not exit, then the asynchronous operation is also micro-queuing, which will not enter the run, and also cause blocking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants