Skip to content

Strengthening the corresponding of supervisor - #2

Open
soranoba wants to merge 2 commits into
lrascao:masterfrom
soranoba:master
Open

Strengthening the corresponding of supervisor#2
soranoba wants to merge 2 commits into
lrascao:masterfrom
soranoba:master

Conversation

@soranoba

Copy link
Copy Markdown
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).

{ok, {Name, List}} = beam_lib:chunks(File, [attributes, exports]),
Behavior = get_behavior(List),
Supervisor = is_supervisor(List),
CodeChange = is_code_change(List),

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

lrascao commented Apr 11, 2016

Copy link
Copy Markdown
Owner

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

@soranoba

Copy link
Copy Markdown
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.

2 participants