https://github.com/sloev/async_botocore
gevent botocore
https://github.com/sloev/async_botocore
Last synced: 5 months ago
JSON representation
gevent botocore
- Host: GitHub
- URL: https://github.com/sloev/async_botocore
- Owner: sloev
- Created: 2017-03-22T20:13:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-23T14:38:28.000Z (over 9 years ago)
- Last Synced: 2025-08-27T13:42:26.913Z (11 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# async_botocore
Use gevent with botocore to call aws services in a nonblocking fashion.
by using gevent Pool and Pool.spawn() you can wrap execution of botocore in greenthreads.
a few important notes:
* always monkey.patch_all as first thing in your app (really first, like Main first, top first, just first, first, first :-)
* let each greenthread have its own connection, this worked for me. So create a function for calling aws services and inside this function; create your connection
* use pool.join(timeout=n) to check if the queue is empty
* use pool.full() to check if there is room in the pool for a new job
* keep running greenthreads in a list to check their results later on