This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import random | |
from time import time, sleep as _sleep | |
""" | |
This gist helps understand the basic implementation of the parallel and series call in python using the asyncio library. | |
The code demonstrates how to invoke asyncio functions and non-asyncio functions asynchronously. | |
Note from the below output - the parallel calls will always be completed in the ascending order of the sleep seconds, | |
where as the series call will be completed in the ascending order of the call id. |