Skip to content

[Context]: add execution strategies (Sequential/Parallel/DedicatedThread) #21

Description

@rian-be

Summary

Add an execution Strategy pattern (SequentialStrategy, ParallelTaskStrategy, DedicatedThreadStrategy) so how a batch is processed can change without touching business code.

Goal

Let processing mode be swapped at runtime (e.g. sequential for debugging, parallel for prod) via a pluggable strategy contract.

Problem

Execution mode is hard-coded in each call. Changing between sequential (debuggable) and parallel requires rewriting call sites.

Scope

  • IExecutionStrategy contract.
  • SequentialStrategy: run tasks in order.
  • ParallelTaskStrategy: standard Task.WhenAll.
  • DedicatedThreadStrategy: for CPU-heavy work (explicit scheduling).
  • Strategy selected via ExecutionOptions or registration.
  • Unit tests: switching strategy changes none of the application code.

Design Expectations

  • Thin; resilient; the strategy orchestrates the base primitives.
  • Business delegates stay identical regardless of strategy.
  • Async-only across strategies.

Acceptance Criteria

  • Swappable strategy without call-site changes.
  • Sequential yields deterministic order; parallel yields completion-speed results.
  • Applies uniformly to batch/map under use-case.

Non-Goals

  • No Parallel.ForEach blocking mode.
  • No new scheduler/threadpool implementation.

Activity

  1. added
    enhancementNew feature or request
    extensionExtension behaviors / helpers
    concurrencyParallel / batch / async execution
    on Aug 7, 2026
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

    concurrencyParallel / batch / async executionenhancementNew feature or requestextensionExtension behaviors / helpers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions