View Source Edeliver.Relup.InsertInstruction (edeliver v1.9.2)

Provides functions to insert relup instructions at a given position

which can be used in Edeliver.Relup.Instruction behaviour implementations in the relup file.

Link to this section Summary

Functions

Appends instruction(s) to the list of other instructions.

Appends instruction(s) to the instruction after the "point of no return" but before any instruction

Inserts instruction(s) after the given instruction.

Inserts instruction(s) right after the last load_object_code instruction

Inserts instruction(s) right after the point of no return.

Inserts instruction(s) before the given instruction.

Inserts instruction(s) before the point of no return.

Returns true if the given instruction is an instruction which modifies an application

Returns true if the given instruction is an instruction which modifies code

Returns true if the given instruction is an instruction which modifies any process

Link to this section Functions

Link to this function

append(instructions, new_instructions)

View Source

Appends instruction(s) to the list of other instructions.

Link to this function

append_after_point_of_no_return(instructions, new_instructions)

View Source

Appends instruction(s) to the instruction after the "point of no return" but before any instruction

which:

  • loads or unloads new code, which means before any load_module, load, add_module, delete_module, remove, purge instruction and
  • before any instruction which updates, starts or stops any running processes, which means before any code_change, update, start, stop instruction and
  • before any instruction which (re-)starts or stops any application or the emulator, which means before any add_application, remove_application, restart_application, restart_emulator and restart_new_emulator instruction.

It does not consider load-instructions for Edeliver.Relup.RunnableInstructions as code loading instructions for the release. They are inserted by the RunnableInstruction itself to ensure that the code of the runnable instruction is loaded before the instruction is executed. See Edeliver.Relup.ShiftInstruction.ensure_module_loaded_before_instruction/3.

Link to this function

insert_after_instruction(instructions, new_instructions, after_instruction)

View Source

Inserts instruction(s) after the given instruction.

Link to this function

insert_after_load_object_code(instructions, new_instructions)

View Source

Inserts instruction(s) right after the last load_object_code instruction

which is usually before the "point of no return" and one of the first instructions. This means that it is the first custom instruction which is executed. It is executed twice, once when checking whether the upgrade can be installed and once when the upgrade is installed.

Link to this function

insert_after_point_of_no_return(instructions, new_instructions)

View Source

Inserts instruction(s) right after the point of no return.

This means that it is the first instruction which should not fail, because the release handler will restart the release if any instruction fails after the point of no return.

Link to this function

insert_before_instruction(instructions, new_instructions, before_instruction)

View Source

Inserts instruction(s) before the given instruction.

Link to this function

insert_before_point_of_no_return(instructions, new_instructions)

View Source

Inserts instruction(s) before the point of no return.

All instructions running before that point of no return which fail will cause the upgrade to fail, while failing instructions running after that point will cause the node to restart the release.

Link to this function

modifies_applications?(arg1)

View Source
@spec modifies_applications?(Edeliver.Relup.Instructions.instruction()) :: boolean()

Returns true if the given instruction is an instruction which modifies an application

by either (re-)starting or stopping it or by restarting the emulator. It returns true for the add_application, remove_application, restart_new_emulator and the restart_emulator, relup instructions.

@spec modifies_code?(Edeliver.Relup.Instructions.instruction()) :: boolean()

Returns true if the given instruction is an instruction which modifies code

by loading, unloading or purging it. It returns true for the load_module, add_module delete_module, load, remove and purge relup instructions.

Link to this function

modifies_processes?(arg1)

View Source
@spec modifies_processes?(Edeliver.Relup.Instructions.instruction()) :: boolean()

Returns true if the given instruction is an instruction which modifies any process

by either by sending the code_change sys event or by starting or stopping any process. It returns true for the code_change, start, stop and update relup instructions.