Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Experimenting with S3 upload using eventmachine

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 data
Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.md
Octocat-spinner-32 s3.yml
README.md

This is a sample project that illustrates some strange behavior I ran into trying to upload files to Amazon S3 using EventMachine and the happening non-blocking S3 client.

You need to update the s3.yml file with your S3 account information and run bundle install. Then you can run either of the two included scripts:

ruby lib/http_upload.rb

or

ruby lib/https_upload.rb

On my machine (Mac OS X) when I run the https script the CPU spikes to 100% and the event loop is blocked for a couple of minutes before the file starts to transfer. However, the http version does not block the event loop, uses almost no CPU, and starts transferring data right away.

Something went wrong with that request. Please try again.