Skip to content

Commit 3d78103

Browse files
committed
Update Worker: add comment to explain @service vs service()
This commit just adds more explanation to the code to explain the reasoning of using runtime vs compile time definition of the service.
1 parent 1666a93 commit 3d78103

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/example/worker.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ defmodule Example.Worker do
33

44
alias Example.DefaultService
55

6+
# When using ElixirLS, defining the service at compile time will result in an
7+
# error because ElixirLS always compiles using MIX_ENV=test which mean @service
8+
# will always be set to MockService, which does not have `foo/0`
69
# @service Application.get_env(:example, :service, DefaultService)
710
# @service DefaultService
811

0 commit comments

Comments
 (0)