7
Utilizing Future Methods
The first of the asynchronous Apex options we have are future methods. Future methods are a form of function as a service that Salesforce provides. These methods enable you to execute some code in a fire-and-forget manner. In this paradigm, a function is called for execution (firing) and placed in a queue to be processed when resources are available (forget). Salesforce will execute future method calls when resources are available on the Salesforce servers. In my experience, this tends to be near-instant unless you are performing a large volume of asynchronous processes.
In this chapter, we are going to discuss how to use future methods, some common use cases, and how to test them appropriately. As part of this discussion, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access