OTP 21 introduces handle_continue
callback to GenServer
September 9, 2018
Let's see how the handle_continue
callback is useful in GenServers.
We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
handle_continue
callback to GenServer
Let's see how the handle_continue
callback is useful in GenServers.
Starting multiple pools, using the Registry to locate pool supervisors and stop them.
Preparing for multiple pools with the pools supervisor.
Remove static process names, provide the worker spec dynamically.
Make workers temporary and have the pool manager in charge of restarting them.
Handle worker deaths. (This is about OTP and not Human Resources...)
Use an ETS table to track client monitors.
Monitor client processes.
Implement worker checkin and checkout.
Make the worker supervisor start workers when it initializes.
Add the (dynamic) worker supervisor and have our pool supervisor start it; convert our code into an OTP application.
Implement the pool manager and have our pool supervisor start it.
Create a new mix project, add a worker and pool supervisor.
This series of posts will guide you in writing an OTP application that will manage pools of processes. In particular, it will do so using features introduced in Elixir 1.6 such as the DynamicSupervisor and the Registry.
Keep on piping with anonymous functions.
with
failed matches
Tagged tuples allow finer control for with
match failures.
Elixir’s pattern matching is great, but make sure it’s not reducing your code’s readability.
An elegant way to process keyword lists elegantly via reduction.