Using Asynchronous Actions

Discuss the benefits and implementation of asynchronous programming.

There are plenty of use cases for implementing synchronous actions within an application. At some point, those synchronous actions won’t be able to scale out should the load on the application increase. This is where asynchronous actions come in. These actions allow many executions to be made using different contexts, whereas synchronous actions will block other actions from executing until the invoked action is complete. This ability to execute without the need to wait for a response allows large-scale message sending without any concern of thread-blocking, which can lead to longer wait times and less-than-desirable performance.

The notion of asynchronous actions has been a paradigm in programming for many years. Using callback functions, which are meant to be executed when one method has completed and returned a value, has been a construct in JavaScript, as well as other languages. Specific patterns such as asynchronous JavaScript and XML (AJAX) were some of the building blocks of web applications using frameworks such as jQuery. Later on, constructs such as promises also helped to extend asynchronous method calls through inline function handlers, providing a more succinct way to ...