Remove koans illustrating self-exit
I don't really like these examples, because the process would exit anyway when the function returns... Also having to sleep is not ideal.
This commit is contained in:
@@ -53,12 +53,6 @@ defmodule Processes do
|
||||
assert_receive ___
|
||||
end
|
||||
|
||||
koan "Killing a process will terminate it" do
|
||||
pid = spawn(fn -> Process.exit(self, :kill) end)
|
||||
:timer.sleep(500)
|
||||
assert Process.alive?(pid) == ___
|
||||
end
|
||||
|
||||
koan "You can also terminate processes other than yourself" do
|
||||
pid = spawn(fn -> receive do end end)
|
||||
|
||||
@@ -93,13 +87,6 @@ defmodule Processes do
|
||||
assert Process.alive?(pid) == ___
|
||||
end
|
||||
|
||||
koan "Exiting normally yourself on the other hand DOES terminate you" do
|
||||
pid = spawn(fn -> Process.exit(self, :normal) end)
|
||||
:timer.sleep(100)
|
||||
|
||||
assert Process.alive?(pid) == ___
|
||||
end
|
||||
|
||||
koan "Parent processes can trap exits for children they are linked to" do
|
||||
Process.flag(:trap_exit, true)
|
||||
spawn_link(fn -> Process.exit(self, :normal) end)
|
||||
|
||||
Reference in New Issue
Block a user