Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve middleware performance #194

Merged
merged 3 commits into from
Dec 10, 2014
Merged

Conversation

jondeandres
Copy link
Contributor

Use Proc objects in the different middlewares to set :request and :context data.

These objects are called when the payload is being prepared, in the same way that data[:person].

@@ -13,6 +13,7 @@ def initialize(app)
end

def call(env)
@request_data = nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this thread-safe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jondeandres
Copy link
Contributor Author

@brianr

I think we don't need more tests for this. The change is that we pass now proc objects, later is evaluated, but the logic itself didn't change.

jondeandres added a commit that referenced this pull request Dec 10, 2014
@jondeandres jondeandres merged commit 8df754d into master Dec 10, 2014
@jondeandres jondeandres deleted the improve-middleware-performance branch December 10, 2014 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants