Durable.LogCapture.IOServer (Durable v0.1.0-rc)
View SourceGenServer that acts as a group_leader to capture IO operations.
This process intercepts IO operations (IO.puts, IO.inspect, etc.) during workflow step execution and forwards them to the log capture buffer.
How It Works
- The process is started and set as the group_leader for the step execution process
- IO operations send
:io_requestmessages to the group_leader - This server captures
:put_charsoperations and adds them to the log buffer - Optionally, output can be passed through to the original group_leader
Configuration
config :durable,
log_capture: [
io_capture: true,
io_passthrough: false # Set to true to also print to console
]
Summary
Functions
Returns a specification to start this module under a supervisor.
Starts the IO capture server.
Stops the IO capture server.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the IO capture server.
Options
:original_leader- Required. The original group_leader to restore/passthrough to.:passthrough- Optional. If true, also sends output to original leader. Default: false.:parent_pid- Required. The PID of the process whose IO we're capturing.
@spec stop(pid()) :: :ok
Stops the IO capture server.