Concurrent Data Processing in Elixir: various errata

On page 26 after start the IEx, the Elixir version is 1.9.4.


On page 31:

iex> {:ok, pid} = GenServer.start(SendServer, [max_retries: 1])
Received arguments: [limit: 1] # instead of limit: 1, it's need to be max_retries: 1

On page 32:

def handle_cast({:send, email}, state) do
  Sender.send_email(email)
  emails = [%{email: email, status: "sent", retries: 0}] ++ state.emails
  # it's missing update the state map and return the new state after update
  {:noreply, state}
end

On page 38, maybe instead of called %Jobber.Job{} struct it could be change for %__MODULE__{}.


On page 38, it is has a private function called random_job_id():

defp random_job_id() do
  :crypto.strong_rand_bytes(5) |> Base.url_encode64(padding: false)
end

So, when called :crypto it’s necessary declare as a extra_applications on mix.exs file, look at on Erlang libraries - The Elixir programming language