An AWS Lambda function is nothing but a function (a block of code) in the cloud. A function can be invoked synchronously or asynchronously. To achieve asynchronous execution in any programming language, we execute functions in a separate thread or process. In Python, for instance, there are various libraries available for achieving asynchronous execution. Similarly, AWS Lambda supports asynchronous execution very well.
Let's take a look at the following code snippet:
client = boto3.client('lambda')response = client.invoke( FunctionName='string', InvocationType='Event'|'RequestResponse'|'DryRun', LogType='None'|'Tail', ClientContext='string', Payload=b'bytes'|file, Qualifier='string')