Skip to content

Instantly share code, notes, and snippets.

@ecin
Created May 19, 2010 00:18
Show Gist options
  • Save ecin/405755 to your computer and use it in GitHub Desktop.
Save ecin/405755 to your computer and use it in GitHub Desktop.
require 'rack'
require 'rack/builder'
require 'rack/lobster'
class MagLevTransactionWrapper
def initialize(app)
@app = app
end
def call(env)
Maglev.abort_transaction
@app.call env
end
end
app = Rack::Builder.new do
use MagLevTransactionWrapper
run Rack::Lobster.new
end
Rack::Handler::WEBrick.run app, :Port => 3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment