Apex

Difference between Synchronous and Asynchronous- Salesforce

Difference between Synchronous and Asynchronous-Salesforce


Synchronous
In simple terms you can assume Synchronous as Sequential. In Synchronous process the thread waits for the task to be completed and then moves to the next task Sequentially. All the tasks are completed in a single thread.

The common example of a Synchronous apex is Trigger.

Asynchronous
In Asynchronous apex the thread does not waits for the task to be completed to move on to the next task. The tasks are run in different threads all together. These threads run in independent silos whenever the system is free.

Most common example is the Future annotation.


Comments are appreciated !

About Saurabh Dua

4 comments:

Powered by Blogger.