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

5 comments:

  1. very simple and good to understand....

    ReplyDelete
  2. Hi sir,
    if u don't mind can u able to elaborate interms of salesforce how its applicable?

    ReplyDelete
  3. Thanks for your post. This is information that I'm interested.
    -----------------------------------------------------------------
    chuyen do choi xe hoi ha noi
    do choi o to gia re
    do choi o to cao cap

    ReplyDelete

Powered by Blogger.