runCommand method

Future<PrivCommandResult> runCommand(
  1. PrivCommand command, {
  2. int? timeoutMillis,
  3. int? maxBytesPerStream,
})

Runs command to completion and returns its captured output.

Both streams are drained concurrently and each is bounded by maxBytesPerStream; excess bytes are still drained so the process can exit, and the matching truncation flag is set.

Leaves timeoutMillis unset to use the 30 second default, or pass noCommandTimeout to disable the deadline. At most four commands run at once; the fifth fails immediately instead of queueing.

Implementation

Future<PrivCommandResult> runCommand(
  PrivCommand command, {
  int? timeoutMillis,
  int? maxBytesPerStream,
}) => _guard(
  () => _platform.runCommand(
    command,
    timeoutMillis: timeoutMillis,
    maxBytesPerStream: maxBytesPerStream,
  ),
);