GenServer managing process substitution execution.
Process substitution (<(command) and >(command)) creates a temp file
via the session's Bash.Filesystem and runs a background command that
reads from or writes to it. The temp file path is returned and can be
used as a file argument to other commands.
Input Process Substitution
Runs the command, captures its stdout to a binary, and writes the result to a VFS temp file. The parent command reads from this path as if it were a regular file.
diff <(sort file1) <(sort file2)Output Process Substitution
Creates a temp file path. The parent command writes to it; the substituted command polls for the file to appear and then reads it as stdin.
tee >(gzip > file.gz) >(bzip2 > file.bz2)Lifecycle
- Created via
start_link/1with command AST and session state - Generates a unique temp path in session's temp directory
- Spawns background process to run the command
- Returns temp file path synchronously
- Background process runs until command completes
- Cleanup happens on GenServer stop (temp file removed via VFS)
State Machine
stateDiagram-v2
[*] --> Initialising: start_link/1
Initialising --> Running: handle_continue setup
Running --> Done: worker_done message
Done --> [*]: stop/1
Summary
Functions
Returns a specification to start this module under a supervisor.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.