Skip to content

Instantly share code, notes, and snippets.

@guilleiguaran
Last active August 29, 2015 14:16
Show Gist options
  • Save guilleiguaran/c720d1d4cb591ef27d32 to your computer and use it in GitHub Desktop.
Save guilleiguaran/c720d1d4cb591ef27d32 to your computer and use it in GitHub Desktop.
require 'gctools/oobgc'
module GC
module OOB
module PumaMiddleware
def self.new(app)
ObjectSpace.each_object(Puma::Server) do |s|
s.extend(self)
end
app
end
def process_client(client, buffer)
super(client, buffer) # Puma::Server#process_client
GC::OOB.run
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment