Skip to content

Async call to node api #1

Closed
Closed
@sunoru

Description

@sunoru

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) raises RangeError: Maximum call stack size exceeded.

For example,

using NodeCall
import NodeCall: UvRunMode, UV_RUN_NOWAIT

function sometask()
    node"setTimeout(() => console.log('Done'), 2000)"
    loop = node_uvloop()
    @async let ret = 1
        while ret != 0
            sleep(0.5)  # or `yeild()` to make the task not blocking
            ret = @ccall :libjlnode.uv_run(loop::Ptr{Cvoid}, UV_RUN_NOWAIT::UvRunMode)::Cint
        end
    end
end

p = sometask()
wait(p)

throws

undefined:0


RangeError: Maximum call stack size exceeded
Thrown at:

No matter which UvRunMode is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions