ExQuality.Printer (ExQuality v0.5.0)

View Source

Serializes output from parallel stages to prevent interleaving.

Each stage calls print_result/1 when complete, which acquires a lock and prints the entire summary atomically. This ensures that if multiple stages complete simultaneously, their output won't be interleaved.

Usage

{:ok, _pid} = ExQuality.Printer.start_link()

# From multiple parallel tasks:
ExQuality.Printer.print_result(result)

ExQuality.Printer.stop()

Summary

Functions

Returns a specification to start this module under a supervisor.

Prints a simple message atomically.

Prints a stage result atomically.

Starts the printer agent.

Stops the printer agent.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])

@spec start_link(keyword()) :: Agent.on_start()

Starts the printer agent.

stop()

@spec stop() :: :ok

Stops the printer agent.