Octave.NET icon indicating copy to clipboard operation
Octave.NET copied to clipboard

Add task based execute

Open mkwired opened this issue 7 months ago • 0 comments

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 avatar Apr 27 '26 03:04 mkwired