Implement synchronous run for asynchronous tasks

This is a programming problem of running two asynchronous function in synchronous manner.  We have few async tasks t1, t2 and t3.

We want to implement a runSync method which takes array of these tasks, but run them synchronously.

Lets create a task array, tasks = [t2, t3, t1], and t3 should run only when t2 is finished and then run t1.


Leave a Reply

Your email address will not be published. Required fields are marked *