From 578fddd43fa3f9d1efb52106e8a73053aa244c4b Mon Sep 17 00:00:00 2001 From: Keith Salisbury Date: Wed, 29 Jan 2020 12:17:05 +0000 Subject: [PATCH] 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. --- lib/example/worker.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/example/worker.ex b/lib/example/worker.ex index 4ee380f..aed9473 100644 --- a/lib/example/worker.ex +++ b/lib/example/worker.ex @@ -3,6 +3,9 @@ defmodule Example.Worker do alias Example.DefaultService + # When using ElixirLS, defining the service at compile time will result in an + # error because ElixirLS always compiles using MIX_ENV=test which mean @service + # will always be set to MockService, which does not have `foo/0` # @service Application.get_env(:example, :service, DefaultService) # @service DefaultService