Some days ago I imported a WSDL into Salesforce and (different of some years ago) it created an Async class (and of course the sync class). So I decided to search on Google how to use this Async class. I've found some articles about that and I implemented this solution for test... For my surprise, the Async class can't be called inside a trigger. Now I'm asking myself and now asking you all: What's difference between of using this Async class and use @future method (and use Sync class)?
1 Answer
The Async class is intended to be used in a continuation. See Make Long-Running Callouts from a Visualforce Page
Basically, a continuation will provide a callback mechanism so that when the async callout is complete you can bring the result back to the client.
A @future method won't provide that callback mechanism. It's more fire and forget.
-
But on trigger context (that you can't wait for an awnser), are @future method and Async class equals? Commented May 1, 2016 at 23:45
-