edeliver_fork v1.4.5 Edeliver.Relup.InsertInstruction
Provides functions to insert relup instructions at a given position
which can be used in Edeliver.Relup.Instruction
behaviour implementations
in the relup file.
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
Functions
Specs
append(Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions, new_instructions :: Edeliver.Relup.Instructions.instruction | Edeliver.Relup.Instructions.instructions) :: updated_instructions :: Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions
Appends instruction(s) to the list of other instructions.
Specs
append_after_point_of_no_return(Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions, new_instructions :: Edeliver.Relup.Instructions.instruction | Edeliver.Relup.Instructions.instructions) :: updated_instructions :: Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions
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
andrestart_new_emulator
instruction.It does not consider load-instructions for
Edeliver.Relup.RunnableInstruction
s as code loading instructions for the release. They are inserted by theRunnableInstruction
itself to ensure that the code of the runnable instruction is loaded before the instruction is executed. SeeEdeliver.Relup.ShiftInstruction.ensure_module_loaded_before_instruction/3
.
Specs
insert_after_instruction(Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions, new_instructions :: Edeliver.Relup.Instructions.instruction | Edeliver.Relup.Instructions.instructions, after_instruction :: Edeliver.Relup.Instructions.instruction) :: updated_instructions :: Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions
Inserts instruction(s) after the given instruction.
Specs
insert_after_load_object_code(Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions, new_instructions :: Edeliver.Relup.Instructions.instruction | Edeliver.Relup.Instructions.instructions) :: updated_instructions :: Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions
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.
Specs
insert_after_point_of_no_return(Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions, new_instructions :: Edeliver.Relup.Instructions.instruction | Edeliver.Relup.Instructions.instructions) :: updated_instructions :: Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions
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.
Specs
insert_before_instruction(Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions, new_instructions :: Edeliver.Relup.Instructions.instruction | Edeliver.Relup.Instructions.instructions, before_instruction :: Edeliver.Relup.Instructions.instruction) :: updated_instructions :: Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions
Inserts instruction(s) before the given instruction.
Specs
insert_before_point_of_no_return(Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions, new_instructions :: Edeliver.Relup.Instructions.instruction | Edeliver.Relup.Instructions.instructions) :: updated_instructions :: Edeliver.Relup.Instructions.t | Edeliver.Relup.Instructions.instructions
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.
Specs
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.
Specs
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.
Specs
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.