Quantcast
Channel: What is the difference between synchronous and asynchronous programming (in node.js) - Stack Overflow
Browsing all 11 articles
Browse latest View live

Answer by Willem van der Veen for What is the difference between synchronous...

Asynchronous programming in JS:Synchronous Stops execution of further code until this is done.Because it this stoppage of further execution, synchronous code is called 'blocking'. Blocking in the sense...

View Article



Answer by user8128174 for What is the difference between synchronous and...

Synchronous functions are blocking while asynchronous functions are not. In synchronous functions, statements complete before the next statement is run. In this case, the program is evaluated exactly...

View Article

Answer by Neeraj Bansal for What is the difference between synchronous and...

Sync ProgrammingProgramming languages like C, C#, Java are sync programming, what so ever you write will be execute in order of your writing.-GET DATA FROM SQL.//Suppose fetching data take 500...

View Article

Answer by Jay for What is the difference between synchronous and asynchronous...

First, I realize I am late in answering this question.Before discussing synchronous and asynchronous, let us briefly look at how programs run.In the synchronous case, each statement completes before...

View Article

Answer by Anton Chan for What is the difference between synchronous and...

The function makes the second one asynchronous.The first one forces the program to wait for each line to finish it's run before the next one can continue. The second one allows each line to run...

View Article


Answer by Santosh Panda for What is the difference between synchronous and...

The difference between these two approaches is as follows:Synchronous way:It waits for each operation to complete, after that only it executes the next operation.For your query:The console.log()...

View Article

Answer by Martijn for What is the difference between synchronous and...

This would become a bit more clear if you add a line to both examples:var result = database.query("SELECT * FROM hugetable");console.log(result.length);console.log("Hello World");The second...

View Article

Answer by related for What is the difference between synchronous and...

In the synchronous case, the console.log command is not executed until the SQL query has finished executing.In the asynchronous case, the console.log command will be directly executed. The result of...

View Article


Answer by thebreiflabb for What is the difference between synchronous and...

The main difference is with asynchronous programming, you don't stop execution otherwise. You can continue executing other code while the 'request' is being made.

View Article


Answer by Salvatorelab for What is the difference between synchronous and...

The difference is that in the first example, the program will block in the first line. The next line (console.log) will have to wait.In the second example, the console.log will be executed WHILE the...

View Article

What is the difference between synchronous and asynchronous programming (in...

I've been reading nodebeginnerAnd I came across the following two pieces of code.The first one: var result = database.query("SELECT * FROM hugetable"); console.log("Hello World");The second one:...

View Article
Browsing all 11 articles
Browse latest View live




Latest Images