Created
March 23, 2017 17:27
-
-
Save sloev/9ffec50e45c15f4ee388e6b35c61a740 to your computer and use it in GitHub Desktop.
gevent with botocore example (python 2.7)
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
from gevent import monkey, joinall, spawn | |
monkey.patch_all() | |
import botocore.session | |
def invoke_lambda(): | |
session = botocore.session.get_session() | |
client = session.create_client('lambda') | |
return client.invoke( | |
FunctionName='test', | |
InvocationType="RequestResponse" | |
) | |
results = joinall([ | |
gevent.spawn(invoke_lambda), | |
gevent.spawn(invoke_lambda) | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment