3 ms·
Very interesting! Thanks so much for sharing. I have a couple questions: 1) The `bump` function interacts with the worker GenServers via `send(pid, :bump)` and
by losvedir 6y ago
Very interesting! Thanks so much for sharing. I have a couple questions:
1) The `bump` function interacts with the worker GenServers via `send(pid, :bump)` and the GenServer has a `handle_info` for that. I would normally add a client function to the worker module which uses a `GenServer.call(...)` instead. Was that just to make the blog post a bit shorter, or are there tradeoffs I'm missing?
2) In the case of millions of pages, the post suggests terminating the processes. What about `hibernate`? Could that be an intermediate approach to reach for, for some relatively large number of pages?
- josevalim 6y ago1) I wanted it to be async as there is not much reason to wait for the process since the database writes are async too. So either send/2 or cast/2 would be fine. 2) Good call on hibernate. It could definitely be an option to consider on all implementations.