Queueable classes

With the recent Spring '15 release, Apex developers have a new asynchronous tool, queueable Apex classes. At first glance, queueable classes are very similar to @future annotated methods. A closer look, however, reveals their true power. There are three key differences between @future and queueable classes:

  • The method for enqueueing a job returns an ID, allowing you to monitor its progress much like a batch or scheduled job
  • Queueable jobs accept sObjects
  • Finally, and perhaps most importantly, queueable code can invoke queueable code—no more exceptions complaining about how you are trying to call the @future methods or batch methods from an @future context

Implementing the queueable interface is very similar to implementing the batchable ...

Get Mastering Application Development with Force.com 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.