Something like:
import eventlet
eventlet.monkey_patch()
import boto.s3
conn = boto.s3.S3Connection(AMAZON_ID, AMAZON_KEY)
bucket = conn.create_bucket(BUCKET)
def upload(s):
# can't reuse the conn/bucket from above here -- I've tried
conn = boto.s3.S3Connection(AMAZON_ID, AMAZON_KEY)
bucket = conn.get_bucket(BUCKET)
k = Key(bucket)
k.key = <something>
k.set_contents_from_string(s, 'public-read')
pile = eventlet.GreenPile(10) # tweak concurrency to your liking
for i in someLoop:
pile.spawn(upload, <something else>)
# block until all uploads complete
list(pile)
m
> --
> You received this message because you are subscribed to the Google Groups "boto-users" group.
> To post to this group, send email to boto-...@googlegroups.com.
> To unsubscribe from this group, send email to boto-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/boto-users?hl=en.
>
--
Matt Billenstein
ma...@vazor.com
http://www.vazor.com/