concept to - do server in category elixir

appears as: to-do server, to-do server, to-do servers, to-do servers
Elixir in Action

This is an excerpt from Manning's book Elixir in Action.

For practice, try to change the to-do server to run as a registered process. The interface of the server will then be simplified, because you don’t need to keep and pass the server’s pid.

6.2.8 Exercise: GenServer-powered to-do server

Let’s wrap up this chapter with a simple but important exercise. For practice, try to change the to-do server, implemented earlier in this chapter, to work with the GenServer behaviour. This should be a straightforward task, but if you get stuck, the solution is in the todo_server.ex file.

Listing 12.2 Global registration of to-do servers (todo_distributed/lib/todo/server.ex)
defmodule Todo.Server do
  ...

  def start_link(name) do
    GenServer.start_link(Todo.Server, name, name: global_name(name))
  end

  defp global_name(name) do
 {:global, {__MODULE__, name}}    #1  
  end

  ...
end

#1   Global registration
Elixir in Action

This is an excerpt from Manning's book Elixir in Action.

For practice, try to change the to-do server to run as a registered process. The interface of the server will then be simplified, because you don’t need to keep and pass the server’s pid. Here’s an example of how such a server can be used:

Let’s wrap up this chapter with a simple but important exercise. For practice, try to change the to-do server, implemented earlier in this chapter, to work with the gen_server behaviour. This should be a straightforward task, but if you get stuck, the solution is in the todo_server.ex file. Be sure to either finish this exercise or analyze and understand the solution, because in future chapters you’ll gradually expand on this simple server process and build a highly concurrent distributed system.

Listing 12.1. Global registration of to-do servers (todo_distributed/lib/todo/server.ex)