Astarte.Flow.Blocks.MapSplitter (astarte_flow v0.1.0)
Breaks a map message into several messages, one for each map item.
Link to this section Summary
Link to this section Functions
Link to this function
split_map(message, config)
@spec split_map(Astarte.Flow.Message.t(), Astarte.Flow.Blocks.MapSplitter.Config.t()) :: {:ok, [Astarte.Flow.Message.t()]} | {:error, reason :: term()}
Split a map message into a different message for each key.
Link to this function
start_link(opts)
@spec start_link([Astarte.Flow.Blocks.MapSplitter.Config.option()]) :: GenServer.on_start()
Starts the MapSplitter.
options
Options
:key_action- the action to apply to the message key, such as:none,{:replace, delimiter},{:append, delimiter}and{:prepend, delimiter}.:fallback_action- fallback action that is performed when a message does not have map type, such as:discard,{:replace_key, new_key}and:pass_through.