[SalesForce] @future method vs Async callout

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)?

Best Answer

The Async class is intended to be used in a continuation. See Make Long-Running Callouts from a Visualforce Page

enter image description here

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.

Related Topic