Skip to content

Multiplex concurrent nsgi_handle calls onto Fibers with a Fiber::Scheduler #4

Description

@himura467

Goal

Handle many concurrent nsgi_handle calls efficiently by multiplexing them onto Fibers inside the single Ruby VM.

Tasks

  • Fiber-per-request dispatch: each dequeued job runs in its own Fiber under a Fiber::Scheduler, so I/O waits in app code yield instead of blocking the VM thread
  • Minimal built-in Fiber::Scheduler (io_wait, kernel_sleep, block/unblock) driving the reactor loop, including the job-queue wake pipe
  • Pluggable scheduler: allow swapping in async/io-event instead of the built-in one (loose coupling — the app contract must not depend on which scheduler runs)
  • Backpressure: bound in-flight jobs so a slow app degrades gracefully instead of piling up blocked host threads

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions