镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

async versions of slow libuv calls? #93

Description

@ronag

e.g. child_process.spawn and os.cpus() can be very slow calls that cause lag on the main thread. Would it make sense to perform async versions of these calls that run on a worker thread?

Activity

  1. RafaelGSS commented on Jun 2, 2023

    @RafaelGSS
    Member

    Shouldn't spawn already be the non-blocking operation? Considering child_process.spawnSync already exists.

  2. aduh95 commented on Jun 2, 2023

    @aduh95

    If there's a way to make it more async, I'll be interested to hear that, I have attempted to come up with a promise API for child_process API, and couldn't find a design that made sense. If there's space for more asyncness, that'd be ideal for a new Promise API I think.

  3. ronag commented on Jun 2, 2023

    @ronag
    MemberAuthor

    Shouldn't spawn already be the non-blocking operation? Considering child_process.spawnSync already exists.

    It is async in terms of IO, but it's not async in terms of computation.

  4. kvakil commented on Jun 8, 2023

    @kvakil

    see nodejs/node#14917 re async spawn

  5. metcoder95 commented on Jun 14, 2023

    @metcoder95
    Member

    If there's a way to make it more async, I'll be interested to hear that, I have attempted to come up with a promise API for child_process API, and couldn't find a design that made sense. If there's space for more asyncness, that'd be ideal for a new Promise API I think.

    @aduh95 What were the design limitations or issues you faced?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions