kfnode
is a meta-behavior that all parts of the pipe, such
as buffers and demultiplexors, are build upon.
Copyright © 2019 Klarna Bank AB (publ)
Behaviours: gen_statem.
This module defines the kfnode behaviour.
Required callback functions: init/2, handle_message/3, handle_flush/2, terminate/2.
kfnode
is a meta-behavior that all parts of the pipe, such
as buffers and demultiplexors, are build upon. This module
implements the following common actions:
initial
state)Note: this is an internal behavior, it shouldn't be used directly
initial | v ?ack | ?feed +-->--ready -->--+ | | | | v | ^ exiting v | | blocked ---<---- working ?done
This is a normal workflow as seen from the perspective of a kfnode.
message() = #kflow_msg{}
feed/3 | Send message to the kfnode and block the caller until the message is processed by this node (but the subsequent processing is done asynchronously). |
get_status/1 | Get various debug information about the node. |
post_init/2 | Tell the node about its neighbours. |
start_link/1 |
feed(Pid::pid(), Msg::message(), Timeout::timeout()) -> ok | {error, term()}
Send message to the kfnode and block the caller until the message is processed by this node (but the subsequent processing is done asynchronously)
get_status(Pid::pid()) -> term()
Get various debug information about the node
post_init(Pid::pid(), Neighbors::{_Upstream::pid(), _Downstream::pid()}) -> ok
Tell the node about its neighbours
start_link(Init_data::#init_data{}) -> {ok, pid()}
Generated by EDoc