...

/

Genserver Callbacks: handle_cast

Genserver Callbacks: handle_cast

Learn how the GenServer uses handle_cast to interact with processes.

The handle_cast callback function

Now, let’s implement sending emails using handle_cast/2. The arguments given to handle_cast/2 are just a term for the message and the state. We pattern match on the message {:send, email}:

 ...