Skip to Main Content
Mastering Elixir
book

Mastering Elixir

by André Albuquerque, Daniel Caixinha
July 2018
Intermediate to advanced content levelIntermediate to advanced
574 pages
14h 7m
English
Packt Publishing
Content preview from Mastering Elixir

Exchanging events

With the channel connection established, we can now focus on sending and receiving events on the channel. The last step for both the upload and download pipelines is the notifier, which is responsible for letting the user know that their upload/download has finished. Now, we need to modify this step to call the ElixirDripWeb umbrella application, so that we emit the event that notifies the user that their operation is done. Here's the updated code for the notifier step:

$ cat apps/elixir_drip/lib/elixir_drip/storage/pipeline/notifier.ex defmodule ElixirDrip.Storage.Pipeline.Notifier do  # ...   defp notify_step(%{media: %{id: id}, user_id: user_id, type: :download}) do ElixirDripWeb.Notifications.notify(:download, id, user_id) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Testing Elixir

Testing Elixir

Andrea Leopardi, Jeffrey Matthias

Publisher Resources

ISBN: 9781788472678Supplemental Content