Skip to Content
Phoenix Web Development
book

Phoenix Web Development

by Brandon Richey
April 2018
Beginner to intermediate content levelBeginner to intermediate
406 pages
9h 33m
English
Packt Publishing
Content preview from Phoenix Web Development

Hooking up the GenServer to our application

This gives us all of the supporting code that we need to be able to work with this, so let's add an entry into our application's list of workers and applications to make sure that our table is created when the application is started and is ready to go! Open up lib/vocial/application.ex, and in the start/2 function, we'll add a new entry to the list of children:

    # Define workers and child supervisors to be supervised    children = [      # Start the Ecto repository      supervisor(Vocial.Repo, []),      # Start the endpoint when the application starts      supervisor(VocialWeb.Endpoint, []),      # Start your own worker by calling: Vocial.Worker.start_link(arg1, arg2, arg3)      # worker(Vocial.Worker, [arg1, arg2, arg3]), supervisor(VocialWeb.Presence, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Phoenix in Action

Phoenix in Action

Geoffrey Lessel
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781787284197Supplemental Content