Skip to content

Commit

Permalink
feat(ExTop): halt on pressing "q"
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarshkukreti committed Oct 13, 2015
1 parent 811b953 commit b3e212f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ex_top.ex
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ defmodule ExTop do
send self, {port, {:data, rest}}
{:noreply, state}
end
def handle_info({port, {:data, "q" <> rest}}, state) do
:erlang.halt
end
def handle_info({_port, {:data, _}}, state) do
{:noreply, state}
end
Expand Down

0 comments on commit b3e212f

Please sign in to comment.