Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: ruby-talk@ruby-lang.org (ruby-talk ML)
Cc: rainbows-talk@rubyforge.org
Subject: [ANN] upr - Upload Progress for Rack (initial release)
Date: Wed, 11 Nov 2009 10:38:45 +0900	[thread overview]
Message-ID: <20091111013842.GB21125@dcvr.yhbt.net> (raw)

upr is Rack middleware that allows browser-side upload progress
monitoring.  It is based-on the "mongrel_upload_progress" module, but
allows any Moneta backing store in addition to DRb.  There is also a
packaged example for using an ActiveRecord model for Rails.

* http://upr.bogomips.org/
* upr@librelist.com
* git://git.bogomips.org/upr.git

You can see upr it in action at http://upr-demo.bogomips.org/
It will report the size and SHA1 of the file you've uploaded.
Much of the demo was stolen from mongrel_upload_progress.

== Web Server Compatibility

While upr is completely Rack::Lint-compatible, upr is only compatible
with Rack web servers that support a streaming "rack.input".  Currently
this is limited to {Rainbows!}[http://rainbows.rubyforge.org/] with a
handful of concurrency models:

* ThreadSpawn
* ThreadPool
* Revactor*

For use with Revactor, the use of network-based Moneta stores or DRb is
only advised if those stores are using Revactor-aware sockets.

== JavaScript/HTML Compatibility

The current developer does not react well with GUIs.  Thus all (R)HTML
and Prototype JavaScript code was stolen from mongrel_upload_progress.

Contributions to add compatibility for more modern things like JQuery
and HTML5 are very welcome.

== Backend Compatibility

We depend on {Moneta}[http://github.com/wycats/moneta], which allows the
use of a multitude of key-value stores.  We also provide a
DRb+Moneta::Memory server to ease transitions from
mongrel_upload_progress.

Additionally, there is an example for using Rails ActiveRecord as a
backend storage mechanism.  Cookie-based upload tracking may eventually
be used, too (contributions very welcome).

== Proxy Compatibility

No proxy is required when used with Rainbows!

The only incompatible HTTP proxy we know of is nginx.  nginx will buffer
large requests to the filesystem before sending them to the backend.
nginx has its own 3rd-party module for
{upload progress}[http://wiki.nginx.org/NginxHttpUploadProgressModule]
and may be used instead of upr.

Most other HTTP-aware and all TCP-only proxies should be compatible.
Disabling Nagle's algorithm in both the Rack web server and proxy is
advised for lower latency, especially with stunnel.

== Unicorn Compatibility

While {Unicorn}[http://unicorn.bogomips.org/] provides the streaming
"rack.input" for Rainbows!, using Unicorn with upr is generally NOT
recommended.  Unicorn only supports fast clients and progress reporting
is unnecessary unless clients are uploading files that are hundreds of
megabyte in size or larger.

== Getting Started

  gem install upr

For Rails, look at the Rails application
{example}[http://git.bogomips.org/cgit/upr.git/tree/examples/rails_app-2.3.4]
and RDoc.  More documentation is on the way.

-- 
Eric Wong



                 reply	other threads:[~2009-11-11  1:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091111013842.GB21125@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=rainbows-talk@rubyforge.org \
    --cc=ruby-talk@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/rainbows.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).