livebook/lib/live_book/application.ex
Jonatan Kłosko 00b06f6e7a
Define session data structure and implement several operations (#6)
* Define session data structure and some operations

* Make code evaluation request async, so that we don't need an intermediary process

* Simplify id typespecs

* Make operation application composable

* Keep a separate evaluation queue per section and actually support concurrent evaluation

* Small fixes

* Validate queued cell type and set evaluation timestamp

* Apply review suggestions

* Add tests

* Store evaluating_cell_id instead of section status

* Add dynamic supervisor for managing evaluator processes

* Some fixes

* Refactor operation application

* Upon cell deletion mark dependent cells as stale
2021-01-13 14:39:04 +01:00

34 lines
1 KiB
Elixir

defmodule LiveBook.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
children = [
# Start the Telemetry supervisor
LiveBookWeb.Telemetry,
# Start the PubSub system
{Phoenix.PubSub, name: LiveBook.PubSub},
# Start the supervisor dynamically managing sessions
LiveBook.SessionSupervisor,
# Start the supervisor dynamically spawning evaluator servers
LiveBook.EvaluatorSupervisor,
# Start the Endpoint (http/https)
LiveBookWeb.Endpoint
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: LiveBook.Supervisor]
Supervisor.start_link(children, opts)
end
# Tell Phoenix to update the endpoint configuration
# whenever the application is updated.
def config_change(changed, _new, removed) do
LiveBookWeb.Endpoint.config_change(changed, removed)
:ok
end
end