Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rack::Chain uses fibers to minimize stack depth in Rack applications.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 rack-chain.gemspec
README.md

Rack::Chain

Rack::Chain uses fibers to minimize stack depth in Rack applications.

A Rack application assembled with Rack::Chain runs each middleware #call in a separate fiber, thereby avoiding deep stacks.

The name "chain" comes from javax.servlet.FilterChain, which is the equivalent pattern to Rack middleware in the Java Servlet API.

Until the Rack API morphs into a before/after pattern which would allow decomposing the request pipeline into a flat sequence of function applications over a request and a response, these kinds of cheeky gyrations may be necessary.

Requirements

Because Rack::Chain relies on fibers for its operation, Ruby 1.9 is required.

Usage

To use Rack::Chain with existing Rack applications, place the following lines in your config.ru:

require 'rack/chain'
extend Rack::Chain::Linker
Something went wrong with that request. Please try again.