Synchronous and asynchronous in Java interaction mode

Source: Internet
Author: User

The interaction in Java is divided into two types: synchronous and asynchronous.

1. Synchronous interaction: Refers to send a request, need to wait to return, and then be able to send the next request, there is a wait process;

2. Asynchronous interaction: Refers to send a request, do not need to wait for the return, at any time can send the next request, that is, no wait;

Difference:

One needs to wait, one does not need to wait, and in some cases, our project development will prioritize asynchronous interactions that do not need to wait.

What are the recommended scenarios for synchronizing interactions? such as bank transfer system, database storage operations, etc., will use synchronous interaction, the rest of the priority use of asynchronous interaction;

Synchronous and asynchronous in Java interaction mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.