Phoenix.CodeReloader

Phoenix.CodeReloader

A plug and module to handle automatic code reloading.

For each request, Phoenix checks if any of the modules previously compiled requires recompilation via __phoenix_recompile__?/0 and then calls mix compile for sources exclusive to the web directory.

To avoid race conditions, all code reloads are funneled through a sequential call operation.

Summary

Functions

call(conn, opts)

API used by Plug to invoke the code reloader on every request

init(opts)

API used by Plug to start the code reloader

reload!(endpoint)

Reloads code for the current Mix project by invoking the :reloadable_compilers

Functions

call(conn, opts)

API used by Plug to invoke the code reloader on every request.

init(opts)

API used by Plug to start the code reloader.

reload!(endpoint)

Specs

reload!(module) :: :ok | {:error, binary}

Reloads code for the current Mix project by invoking the :reloadable_compilers.

This is configured in your application environment like:

config :your_app, YourApp.Endpoint,
  reloadable_compilers: [:gettext, :phoenix, :elixir]

Keep in mind :reloadable_compilers must be a subset of the :compilers specified in project/0 in your mix.exs.

© 2014 Chris McCord
Licensed under the MIT License.
https://hexdocs.pm/phoenix/Phoenix.CodeReloader.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部