Protocol::HTTPSourceProtocolHTTPMiddleware

class Middleware

The middleware interface provides a convenient wrapper for implementing HTTP middleware.

A middleware instance generally needs to respond to two methods:

The call method is called for each request. The close method is called when the server is shutting down.

You do not need to use the Middleware class to implement middleware. You can implement the interface directly.

Nested

Definitions

def self.for(&block)

Convert a block to a middleware delegate.

Implementation

def self.for(&block)
	def block.close
	end
	
	return self.new(block)
end