livebook/test/support/noop_runtime.ex
Jonatan Kłosko 20ff5c95b8
Suggest restarting runtime on Mix.install error and add restart shortcut (#418)
* Suggest restarting runtime on Mix.install error and add restart shortcut

* Apply review comments
2021-07-01 13:23:07 +02:00

20 lines
577 B
Elixir

defmodule Livebook.Runtime.NoopRuntime do
@moduledoc false
# A runtime that doesn't do any actual evaluation,
# thus not requiring any underlying resources.
defstruct []
def new(), do: %__MODULE__{}
defimpl Livebook.Runtime do
def connect(_), do: :ok
def disconnect(_), do: :ok
def evaluate_code(_, _, _, _, _, _ \\ []), do: :ok
def forget_evaluation(_, _, _), do: :ok
def drop_container(_, _), do: :ok
def request_completion_items(_, _, _, _, _, _), do: :ok
def duplicate(_), do: {:ok, Livebook.Runtime.NoopRuntime.new()}
end
end