ZapClient.overProcess constructor

ZapClient.overProcess(
  1. Process process
)

Builds a client wired to a live Process (stdin/stdout NDJSON).

Implementation

factory ZapClient.overProcess(Process process) {
  final inbound = process.stdout
      .transform(const Utf8Decoder(allowMalformed: true))
      .transform(const LineSplitter());
  return ZapClient(
    inbound: () => inbound,
    // encodeLine already terminates with \n — write it verbatim.
    send: process.stdin.write,
  );
}