Skip to content

Commit

Permalink
rename command to exec to reduce name overload (visually)
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin67 committed Nov 3, 2023
1 parent 18538dc commit 095823a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dev/v1.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Inngest.Dev.EventFn2 do
@trigger %Trigger{event: "test/hello"}

@impl true
def run(%{run_id: run_id, step: step} = _args) do
def exec(%{run_id: run_id, step: step} = _args) do

Check warning on line 11 in dev/v1.ex

View workflow job for this annotation

GitHub Actions / Dialyzer

variable "run_id" is unused (if the variable is not meant to be used, prefix it with an underscore)
greet =
step.run("hello", fn ->
"Hello world"
Expand Down
2 changes: 1 addition & 1 deletion lib/inngest/function.ex
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ defmodule Inngest.Function do
@doc """
The method to be called when the Inngest function starts execution
"""
@callback run(Handler.t()) :: {:ok, any()} | {:error, any()}
@callback exec(Handler.t()) :: {:ok, any()} | {:error, any()}

defmacro __using__(_opts) do
quote location: :keep do
Expand Down
2 changes: 1 addition & 1 deletion lib/inngest/handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule Inngest.Handler do

@spec invoke(t(), Inngest.Function) :: {200 | 206 | 400 | 500, map()}
def invoke(handler, mod) do
case mod.run(handler) do
case mod.exec(handler) do
{:ok, val} -> {200, val}
{:error, val} -> {400, val}
end
Expand Down
2 changes: 1 addition & 1 deletion test/support/funcs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Inngest.TestEventFn do
}

@impl true
def run(args) do
def exec(args) do

Check warning on line 17 in test/support/funcs.ex

View workflow job for this annotation

GitHub Actions / Test

variable "args" is unused (if the variable is not meant to be used, prefix it with an underscore)
{:ok, "hello world"}
end

Expand Down

0 comments on commit 095823a

Please sign in to comment.