bitcrowd / chromic_pdf

Convenient HTML to PDF/A rendering library for Elixir based on Chrome & Ghostscript
Apache License 2.0
409 stars 37 forks source link

Use DynamicSupervisor for on_demand mode. #234

Closed maltoe closed 1 year ago

maltoe commented 1 year ago

relates to #233

maltoe commented 1 year ago

@andreasknoepfle Please :eyes: this only when you have a lot of time. It's not urgent.

In fact, I'm second guessing myself:

pid = spawn(fn ->
  try do
    :timer.sleep(1000)
  after
    IO.puts("never executes")
  end
end)

Process.exit(pid, :kill)
:timer.sleep(1000)

When the client process exits, the after is never executed and hence the DynamicSupervisor child will not be terminated :scream:

maltoe commented 1 year ago

Yeah, nevermind this.