GenServer Callbacks
Learn about different GenServer callbacks in Elixir.
We'll cover the following...
- GenServer
- init(start_arguments)
- handle_call(request, from, state)
- handle_cast(request, state)
- handle_info(info, state)
- terminate(reason, state)
- code_change(from_version, state, extra)
- format_status(reason, [pdict, state])
- { :noreply, new_state [ , :hibernate | timeout ] }
- { :stop, reason, new_state }
- { :reply, response, new_state [ , :hibernate | timeout ] }
- { :stop, reason, reply, new_state }
GenServer
GenServer is an OTP protocol. OTP works by assuming that our module defines a number of callback functions. There are six in the case of a GenServer. If we were writing a GenServer in ...