Skip to content

Add task based execute#19

Open
mkwired wants to merge 13 commits into
triforcely:masterfrom
mkwired:add-task-based-execute
Open

Add task based execute#19
mkwired wants to merge 13 commits into
triforcely:masterfrom
mkwired:add-task-based-execute

Conversation

@mkwired

@mkwired mkwired commented Apr 27, 2026

Copy link
Copy Markdown

Summary

Adds task-based Octave command execution with cancellation support and hardens process lifecycle handling around errors, timeouts, disposal, and pooled worker reuse.

Changes

  • Added OctaveContext.Execute(string command, CancellationToken cancellationToken) for asynchronous command execution.
  • Serialized sync and async execution per context to avoid overlapping writes to the same Octave REPL process.
  • Added cancellation and disposal handling that interrupts or retires active workers instead of returning unsafe processes to the pool.
  • Improved command completion detection by waiting for both stdout and stderr command-boundary markers.
  • Retired workers after stderr errors, timeouts, process exits, cancellation, and failed writes so later executions can recover with a fresh process.
  • Reworked ObjectPool<T> to use SemaphoreSlim for concurrency limits and added explicit disposal/idle reclaim cleanup.
  • Updated tests for async execution, cancellation, disposal races, process
  • dotnet build src/Octave.NET/Octave.NET.csproj -f netstandard2.0 --no-restore
  • dotnet build src/Octave.NET/Octave.NET.csproj -f net10.0 --no-restore

mkwired and others added 13 commits April 26, 2026 20:17
… Octave.NET

Co-authored-by: Copilot <copilot@github.com>
…build paths

Co-authored-by: Copilot <copilot@github.com>
…d add OctaveTestEnvironment for configuration
Replace polling-based max-concurrency waits with SemaphoreSlim-backed leases.  Make the reclaim loop cancellation-aware, add deterministic disposal for the background reclaim task, and dispose returned items safely after pool disposal.

Add focused unit tests for reuse, replacement, blocking behavior, factory failure lease release, idle reclaim, and disposal paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant