Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This is a sample project that illustrates some strange behavior I ran into trying to upload files to Amazon S3 using [EventMachine][http://rubyeventmachine.com/] and the [happening][http://github.com/peritor/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. |