The Encryption stage

On the download pipeline, the Encryption stage subscribes to events coming from the RemoteStorage stage. Similarly to the Notifier stage, the function that handles download events for this stage lives side by side with the function that handles upload events.

This time, however, the Encryption module has two encryption_step/1 functions to handle download events: one that pattern-matches on the :original value of the status event field and one that handles all the other download events, corresponding to those cases when the media contents are still encrypted:

$ cat apps/elixir_drip/lib/elixir_drip/storage/pipeline/encryption.exdefmodule ElixirDrip.Storage.Pipeline.Encryption do  # ... def start_link(name, subscription_options), ...

Get Mastering Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.