2021-06-09 22:24:02 +08:00
|
|
|
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
|
2021-07-16 00:19:36 +08:00
|
|
|
def evaluate_code(_, _, _, _, _ \\ []), do: :ok
|
|
|
|
def forget_evaluation(_, _), do: :ok
|
2021-06-09 22:24:02 +08:00
|
|
|
def drop_container(_, _), do: :ok
|
2021-07-21 03:30:53 +08:00
|
|
|
def handle_intellisense(_, _, _, _, _), do: :ok
|
2021-07-01 19:23:07 +08:00
|
|
|
def duplicate(_), do: {:ok, Livebook.Runtime.NoopRuntime.new()}
|
2021-06-09 22:24:02 +08:00
|
|
|
end
|
|
|
|
end
|