Asyn­chronous pro­gram­ming

OpenSource For You - - DEVELOPERS -

In JavaScript, there was only a call­back mech­a­nism which al­lowed asyn­chronous pro­gram­ming. The gen­er­a­tors fea­ture takes asyn­chronous pro­gram­ming to an en­tirely new level. In the above ex­am­ple, we have seen the key­word ‘yield’ fol­lowed by an ex­pres­sion. The key­word ‘yield’ can be fol­lowed by async func­tions such as file fetch, URL fetch or data­base op­er­a­tions.

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.