Merge branch 'single-api' into develop

This commit is contained in:
Jordan Bracco 2020-06-15 18:19:30 +02:00
commit 52f6aa7281
2 changed files with 6 additions and 4 deletions

View file

@ -29,11 +29,11 @@ defmodule GenMagic do
end
end
defp do_perform({GenMagic.Helpers, _}, timeout) do
defp do_perform({GenMagic.Helpers, _}, path, timeout) do
GenMagic.Helpers.perform_once(path, timeout)
end
defp do_perform({mod, name}, path) do
defp do_perform({mod, name}, path, timeout) do
mod.perform(name, path, tiemout)
end

View file

@ -57,6 +57,9 @@ defmodule GenMagic.Server do
| {:recycle_threshold, non_neg_integer() | :infinity}
| {:database_patterns, nonempty_list(:default | Path.t())}
@type target :: Path.t() | {:bytes, binary()}
@type result :: {:ok, Result.t()} | {:error, term() | String.t()}
@typedoc """
Current state of the Server:
@ -83,8 +86,7 @@ defmodule GenMagic.Server do
@spec child_spec([option()]) :: Supervisor.child_spec()
@spec start_link([option()]) :: :gen_statem.start_ret()
@spec perform(t(), Path.t() | {:bytes, binary()}, timeout()) ::
{:ok, Result.t()} | {:error, term() | String.t()}
@spec perform(t(), target(), timeout()) :: result()
@spec status(t(), timeout()) :: {:ok, Status.t()} | {:error, term()}
@spec stop(t(), term(), timeout()) :: :ok