What is a Resonate Call Graph?
A Resonate Call Graph is the full set of durable promises and function executions from ephemeral edge to ephemeral edge. That is — a Call Graph is a map of the durable world.
To illustrate this, consider a promise and function execution pair.
You will notice that in Call Graph diagrams, promises and function executions are shown in pairs.
This is because there is a 1:1 relationship between a durable promise and a durable (logical) execution where a durable execution may map to multiple ephemeral (physical) executions.
That is — a physical function execution may error, or be interrupted by a crash - in these cases a function may physically execute multiple times in correlation with a single invocation, represented by the promise.
So, in reality to complete a Call Graph, multiple physical function executions may correlate to a single promise. However, in a Call Graph diagram you will see just a single logical function execution representing the full set of physical function executions required to resolve the promise.
In Resonate, when a function calls another function within the same Application Node, it is considered a Local Function Invocation (LFI).
When a function calls another function in a different Application Node, it is considered a Remote Function Invocation (RFI).
A Resonate Application can make use of both LFIs and RFIs, and thus a Resonate Call Graph can span from one to many Application Nodes.
Promises that correlate to the first invocation in an Application Node are called Root Promises.
The promise that correlates to the first invocation in the Call Graph is called the Call Graph Root Promise.
A Resonate Call Graph is a durable world, that is — the application logic is guaranteed to execute to completion. This does not mean there is a guarantee that every invocation of a Call Graph will result in the happy path of the business process. It means that every function within a Call Graph will Retry and/or Recover per the defined characteristics of the application’s business process.
For example, if one of the Call Graph functions calls an external API (calls out to the ephemeral world) that is not responding, as long as the function is written to surface that error, Resonate guarantees the function will Retry per the Retry Policy until the call succeeds or until the limits of the Retry Policy are reached. If the limits of the Retry Policy are reached, the promise associated with the invocation of the function will be Rejected, and it is up to the application to decide what to do next.