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, ...
Get Mastering Apex Programming - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.