Why Kino.listen doesn't return a pid?
jannikbecher opened this issue · comments
Lines 419 to 428 in 78e58cf
Is there a specific reason why :ok is returned instead of the pid?
It would be nice to be able to do something like this:
job_pid = Kino.listen(5000, fn i -> IO.puts(i) end)
Kino.Control.button("Kill job")
|> Kino.render()
|> Kino.listen(fn _ -> Process.exit(job_pid, :kill) end)
Can you please send a PR?
Just for reference:
Process.exit(job_pid, :kill)
kills the whole cell. Instead use Kino.terminate_child(job_pid)