Last active
April 21, 2020 18:19
-
-
Save Yoshyn/2fd029d57c2e8871730fe4481493c753 to your computer and use it in GitHub Desktop.
Minimal test case to perform an override with newrelic on httpotion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Base do | |
defmacro __using__(_) do | |
quote do | |
def process, do: "Base.process" | |
def request, do: "Base.request" | |
defoverridable Module.definitions_in(__MODULE__) | |
end | |
end | |
end | |
defmodule Client do;use Base;end; Client.request | |
defmodule Client do | |
use Base | |
def request, do: super <> " - " <> "Client" | |
end | |
Client.request "Base.request - Client" | |
defmodule Base.WithExt do | |
defmacro __using__(_) do | |
quote do | |
use Base | |
def request, do: super <> " - " <> "Base.WithExt.request" | |
defoverridable Module.definitions_in(__MODULE__) | |
end | |
end | |
end | |
defmodule Client do | |
use Base.WithExt | |
def process, do: super <> " - " <> "Client" | |
end | |
Client.process | |
Client.request |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment