Skip to content

Conversation

sleipnir
Copy link
Collaborator

No description provided.

Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com>
Comment on lines +71 to +79
@doc """
Initialization for resolvers.

Calls `resolver_module.start(args)` and returns its result.
"""
@spec start_resolver(module(), args :: term()) :: :ok | {:ok, pid()} | {:error, term()}
def start_resolver(resolver, args \\ nil) when is_atom(resolver) do
resolver.start(args)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this function is needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is still a draft, but the idea is that certain resolvers may need specific initialization, for example when their backend is a GenServer, as is the case with the DNS resolver, which is why this function exists.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just that one could easily just call resolver.start(args) directly

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just that one could easily just call resolver.start(args) directly

I will need to interact a little more to know if this is really a fact, I will bring you news soon about this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants