
chriseyre2000
Concurrent Data Processing In Elixir: Chapter 3 Errata
Towards the end of Chapter 3 (B2) the via function is implemented as:
def via(id) do
{{:via, Registry, {ProducerConsumerRegistry, id}}, []}
end
However the app fails to start unless you change this to:
def via(id) do
{:via, Registry, {ProducerConsumerRegistry, id}}
end
Here is the code that I entered as specified in the book: GitHub - chriseyre2000/scraper: Sample app from chapter 3 of Concurrent Data Processing In Elixir
I did restart this chapter from B1 just in case something had changed/been fixed.
First Post!

svilen
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
Popular Pragmatic Bookshelf topics










Other popular topics










Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /ash
- /opensuse
- /centos
- /php
- /deepseek
- /html
- /scala
- /zig
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /sublime-text
- /react-native
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /django
- /manjaro
- /spring
- /diversity
- /nodejs
- /lua
- /julia
- /slackware
- /c
- /neovim