Last active
October 24, 2019 19:12
Revisions
-
kyleparisi revised this gist
Oct 24, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ # {:httpoison, "~> 1.6"} in mix.exs -> deps defmodule DockerEvents do use GenServer -
kyleparisi revised this gist
Oct 24, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ defmodule DockerEvents do def init(:ok) do sock = URI.encode_www_form("/var/run/docker.sock") url = "http+unix://#{sock}/events" {:ok, HTTPoison.get!(url, [], [stream_to: self, recv_timeout: :infinity])} end def handle_info(msg, state) do -
kyleparisi created this gist
Oct 24, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ defmodule DockerEvents do use GenServer def start_link(opts \\ []) do GenServer.start_link(__MODULE__, :ok, opts) end def init(:ok) do sock = URI.encode_www_form("/var/run/docker.sock") url = "http+unix://#{sock}/events" {:ok, HTTPoison.get!(url, [], [stream_to: self])} end def handle_info(msg, state) do IO.inspect {:handle_info, msg} {:noreply, state} end end