Reputation: 93
I am just confused when the responder flow gets executed in flow class and that responder checks and signing the transcation?
Upvotes: 0
Views: 126
Reputation: 23140
There are two types of flow annotations:
InitiatingFlow
, which is used to annotate flows that are started directly (either by other flows, by a service, or via RPC)InitiatedBy
, which is used to annotate flows that the node starts in response to messages from other flows. This annotation takes as its only argument the name of an InitiatingFlow
classWhen a node receives a message from a flow running on another node, it goes through the following process:
It checks whether it has a flow installed that is InitiatedBy
the flow it has a received a message from
If it does, it invokes that flow to commence communication with the InitiatingFlow
If it does not, it throws an exception
So a responder flow instance gets created every time the node receives a message from the responder flow's InitiatedBy
flow. This flow "stays alive" until it has finished communicating with the InitiatedBy
flow instance.
Upvotes: 2