Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move c:process_name/2 to the Broadway behaviour #285

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

whatyouhide
Copy link
Collaborator

It seems like this callback was accidentally generated inside the module calling use Broadway instead of being part of the Broadway behaviour.

This callback was originally introduced in #239.

It seems like this callback was accidentally generated inside the module
calling "use Broadway" instead of being part of the Broadway behaviour.

This callback was originally introduced in
#239.
end

"""
@doc since: "1.1.0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Had to put 1.1.0 here because it's never been available publicly before and I needed a minor version bump to introduce a new feature.

Comment on lines +481 to 492
defp default_process_name(broadway_name, base_name) when is_atom(broadway_name) do
:"#{broadway_name}.Broadway.#{base_name}"
end

defp default_process_name(broadway_name, _base_name) do
raise ArgumentError, """
expected Broadway to be started with an atom :name, got: #{inspect(broadway_name)}

module.process_name(broadway_name, base_name)
If starting Broadway with a :name that is not an atom, you must define the \
process_name/2 callback in the module which calls "use Broadway" (see the documentation).
"""
end
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved the default implementation here, with the function_exported?/3 check.

@whatyouhide whatyouhide merged commit 5600a78 into main Feb 8, 2022
@whatyouhide whatyouhide deleted the andrea/fix-process-name-callback branch February 8, 2022 08:55
@kdawgwilk
Copy link

Could we get a release pushed to hex for this since it fixes a breaking change for those using the warnings_as_errors compiler setting

@whatyouhide
Copy link
Collaborator Author

@kdawgwilk just released v1.0.3. 👍

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

Successfully merging this pull request may close these issues.

3 participants