Skip to content

QueueableWithCalloutRecipes

pozil edited this page May 14, 2024 · 13 revisions

QueueableWithCalloutRecipes

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

Implemented types

Queueable , Database.AllowsCallouts

Group Async Apex Recipes

See RestClient

Fields

private throwErrorBoolean

TESTVISIBLE

private circuitBreakerThrownBoolean

TESTVISIBLE


Methods

public static void execute(QueueableContext qc)

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

Parameters

Param Description
qc dependency injected by the system

Example

System.enqueueJob(new QueueableWithCalloutRecipes());

Classes

QueueableWithCalloutRecipesException

Internal custom exception class

Inheritance

QueueableWithCalloutRecipesException


Clone this wiki locally