2

What I mean is that I want a way of running some kind of loop indefinitely. This loop is going to make a callout to an endpoint, and it needs to be fast (so it can't be scheduled to run 10 to 10 minutes).

Using the Queueable interface I get a System.AsyncException: Maximum stack depth has been reached. error, in a class that is basically running its stuff and then trying to add another instance to the queue.

6

According to the Apex Developer Guide documentation on Queueable Apex, there is no depth limit in most org types. The following should probably be amended to include sandbox organizations:

  • No limit is enforced on the depth of chained jobs, which means that you can chain one job to another job and repeat this process with each new child job to link it to a new child job. For Developer Edition and Trial organizations, the maximum stack depth for chained jobs is 5, which means that you can chain jobs four times and the maximum number of jobs in the chain is 5, including the initial parent queueable job.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.