Concurrent Data Processing In Elixir: Chapter 3 Errata

Thank you for reporting this Christopher! And thanks for sharing the code, it was super helpful.

Looks like I made a mistake when introducing this. Rather than using {{:via, Registry, {ProducerConsumerRegistry, id}}, []} the book should ask you to modify page_consumer_supervisor.ex and update the subscribe_to options like so:

    opts = [
      strategy: :one_for_one,
      subscribe_to: [
        {OnlinePageProducerConsumer.via("online_page_producer_consumer_1"), []},
        {OnlinePageProducerConsumer.via("online_page_producer_consumer_2"), []}
      ]
    ]

However, you can still keep the code that you have at the moment. You’ll just get a warning message like this:

[warn]  :subscribe_to value with type {:via, module(), term()} is deprecated

I’ll make sure this is fixed in the next version :+1: