I have logic inside an Apex Class that will be invoked from a Lightning Component. There are three sequential callouts that will be sent to an External System whenever its method is Called.
As per the Salesforce Governor limits, if a transaction exceeds more than 5 seconds it will be considered a long-running transaction, and there cannot be more than 10 concurrent long-running transactions.
In my case, if each callout took 4 seconds on average, then it would take 12 seconds on average to execute all three callouts. Because this transaction has exceeded 5 secs it will be considered a long-running transaction.
What are the alternative approaches to handle this use case?
Maybe doing an Asynchronous Callout - Continuations method will help. The Continuations method is not yet supported directly from lightning. But we can invoke apex Continuations from lightning as mentioned in this blog.
Appreciate your Suggestions