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

Strengthening the corresponding of supervisor #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

soranoba
Copy link
Contributor

  • Fix a log message.
  • Permit the coexistence of behavi[o]r and behavi[ou]r. (1)
  • Permit the coexistence of supervisor and other behaviour. (2)

(1)

-behaviour(module_a).
-behavior(module_b).

(2)

-behaviour(supervisor).
-behaviour(module_a).

@@ -206,15 +206,15 @@ generate_instruction(deleted, File) ->

generate_instruction(changed, ModDeps, {File, _}) ->
{ok, {Name, List}} = beam_lib:chunks(File, [attributes, exports]),
Behavior = get_behavior(List),
Supervisor = is_supervisor(List),
CodeChange = is_code_change(List),
Copy link
Owner

Choose a reason for hiding this comment

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

With this we'll lose the ability to generate appup instructions for other behaviours

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In other behaviour, I think that there is nothing that it need to generate a special instruction.
As an exception, supecial process and supervisor behaviour will be able to co-exist.
(However, supecial process does not require a behaviour.)

Still do you want a change, such as the following?

generate_instruction_advanced(Name, Behaviours, _, Deps) ->
    case lists:member(supervisor, Behaviours) of
        true  -> {update, Name, supervisor};
        false -> {load_module, Name, Deps}
end

Copy link
Owner

Choose a reason for hiding this comment

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

What are you referring to as a supecial process?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a module export system_code_change or code_change, it shoud have instruction that is {update, Module, {advanced, Extra}}. See also
However, it is not related to behaviour. (it related to is_code_change/1)

Modules except these and supervisor want add_module or delete_module, load_module.

@lrascao
Copy link
Owner

lrascao commented Apr 11, 2016

Thanks for the PR, i've added some notes on 9f2e697

@soranoba
Copy link
Contributor Author

Thank you for the quick response !!

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.

None yet

2 participants