Module dev_patch.erl¶
A device that can be used to reorganize a message: Moving data from one path inside it to another.
Description¶
This device's function runs in two modes:
- When using
all
to move all data at the path given infrom
to the path given into
. - When using
patches
to move all submessages in the source to the target, if they have amethod
key ofPATCH
or adevice
key ofpatch@1.0
.
Source and destination paths may be prepended by base:
or req:
keys to
indicate that they are relative to either of the message's that the
computation is being performed on.
The search order for finding the source and destination keys is as follows,
where X
is either from
or to
:
- The
patch-X
key of the execution message. - The
X
key of the execution message. - The
patch-X
key of the request message. - The
X
key of the request message.
Additionally, this device implements the standard computation device keys, allowing it to be used as an element of an execution stack pipeline, etc.
Function Index¶
all/3 | Get the value found at the patch-from key of the message, or the
from key if the former is not present. |
all_mode_test/0* | |
compute/3 | |
init/3 | Necessary hooks for compliance with the execution-device standard. |
move/4* | Unified executor for the all and patches modes. |
normalize/3 | |
patch_to_submessage_test/0* | |
patches/3 | Find relevant PATCH messages in the given source key of the execution
and request messages, and apply them to the given destination key of the
request. |
req_prefix_test/0* | |
snapshot/3 | |
uninitialized_patch_test/0* |
Function Details¶
all/3¶
all(Msg1, Msg2, Opts) -> any()
Get the value found at the patch-from
key of the message, or the
from
key if the former is not present. Remove it from the message and set
the new source to the value found.
all_mode_test/0 *¶
all_mode_test() -> any()
compute/3¶
compute(Msg1, Msg2, Opts) -> any()
init/3¶
init(Msg1, Msg2, Opts) -> any()
Necessary hooks for compliance with the execution-device
standard.
move/4 *¶
move(Mode, Msg1, Msg2, Opts) -> any()
Unified executor for the all
and patches
modes.
normalize/3¶
normalize(Msg1, Msg2, Opts) -> any()
patch_to_submessage_test/0 *¶
patch_to_submessage_test() -> any()
patches/3¶
patches(Msg1, Msg2, Opts) -> any()
Find relevant PATCH
messages in the given source key of the execution
and request messages, and apply them to the given destination key of the
request.
req_prefix_test/0 *¶
req_prefix_test() -> any()
snapshot/3¶
snapshot(Msg1, Msg2, Opts) -> any()
uninitialized_patch_test/0 *¶
uninitialized_patch_test() -> any()