Skip to content

extend queue to support parallel command processing #86

Description

@zgeoff

The current model is:

dequeue → update state → run handlers → execute commands (sequentially) → enqueue results → repeat

The bottleneck isn't handler execution (those are pure functions, fast). It's command execution — specifically provider writes that hit the GitHub API. Each TransitionWorkItemStatus is a
REST call.

Parallel execution would look like:

dequeue → update state → run handlers → classify commands:
- Independent commands (different work items) → execute in parallel
- Dependent commands (same work item) → execute sequentially
→ collect all results → enqueue events → repeat

The handler independence invariant already guarantees safety here — you just need a classification step in the executor. The compound commands are already designed for this (they encapsulate
dependencies).

Concrete change: In create-command-executor.ts, group commands by work item ID. Commands targeting different work items can Promise.all. Commands targeting the same work item stay
sequential. That's it.

Activity

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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions