-
Notifications
You must be signed in to change notification settings - Fork 1
Async call to node api #1
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
Comments
Actually, any async functions that invoke any node-API would throw this. It is because the API must be used in the main thread. Even showing js values in REPL will throw this error: julia> using NodeCall
julia> a = node"()=>{}"
┌ Debug: napi_string_expected
└ @ NodeCall ~/pro/julia-packages/NodeCall/src/utils.jl:31
Error showing value of type JsFunction{Nothing}:
ERROR: "Maximum call stack size exceeded"
julia> println(a)
JsFunction{Nothing}: ()=>{}
julia> @async println(a)
┌ Debug: napi_string_expected
└ @ NodeCall ~/pro/julia-packages/NodeCall/src/utils.jl:31
Task (failed) @0x00007fe0ab53fc70
Maximum call stack size exceeded |
|
https://nodejs.org/docs/latest-v14.x/api/n-api.html#n_api_asynchronous_thread_safe_function_calls We probably have to invoke by Maybe it's not worth supporting Perhaps a function can be provided to wrap a I'm still not sure how the other |
Instead of wrapping
|
All
uv_run
calls for the event loop of nodeJS from either idle handles of Julia event loop or scheduled tasks (e.g. by@async
) raisesRangeError: Maximum call stack size exceeded
.For example,
throws
No matter which
UvRunMode
is used.The text was updated successfully, but these errors were encountered: