-
Notifications
You must be signed in to change notification settings - Fork 460
QueueableWithCalloutRecipes
pozil edited this page Nov 14, 2024
·
15 revisions
Demmonstrates the use of the Queueable interface to make
callouts. The methods in this class are called by the system at run time.
To enqueue this job and see it's results, use System.enqueueJob(new QueueableWithCalloutRecipes());
More on the Queable interface: https://sfdc.co/queueable-apex
Group Async Apex Recipes
See RestClient
Implements
Queueable, Database.AllowsCallouts
TESTVISIBLE
private static throwError
Boolean
TESTVISIBLE
private static circuitBreakerThrown
Boolean
This is the only required method to implement Queueable. Queueable classes that also implement Database.allowsCallouts can make HTTP requests to external services. In this recipe we make a GET request to developer.salesforce.com
public static void execute(QueueableContext qc)
Name | Type | Description |
---|---|---|
qc | QueueableContext | dependency injected by the system |
void
System.enqueueJob(new QueueableWithCalloutRecipes());
Internal custom exception class