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

Moving Fiber creation up before middleware chain invoked #58

Merged
merged 5 commits into from Jun 22, 2011

Conversation

stevemohapibanks
Copy link
Contributor

This has come out of the discussion around being able to use async calls within middleware. I've moved the Fiber creation up from Goliath::API to Goliath::Request. It's still passing all the specs, and I've been running my version for a couple of weeks on a new internal project, but it would be nice to see it tested against some bigger Goliath apps.

Steve

@igrigorik
Copy link
Member

Hmm, this looks sane.

@dj2: you looked into this in the past, any reason why we didn't do this earlier?

@stevemohapibanks
Copy link
Contributor Author

It seemed the right approach, the key feedback I was interested in is whether the Fiber creation is in the right place. I spent quite a bit of time following the request flow and it seemed the best place.

@igrigorik
Copy link
Member

Yep, no the actual change makes perfect sense to me. The only reason I ask is because we talked about exactly this changeset with @dj2 a while back at the office, and he was going to play with it and commit it, if it made sense.. I'm just not sure if he ever got around to it, and if yes, then why we he didn't push. I'll wait for Dan to confirm/deny... :)

@dj2
Copy link
Contributor

dj2 commented Jun 22, 2011

I made the change, it seemed to work. We talked about the potential performance of having to create the fiber before running the middlewares, which I believe we decided was fine. I then promptly forgot about the whole thing.....

@@ -58,8 +58,22 @@ module Goliath
params.merge!(post_params)
end

params
indifferent_params(params)
Copy link
Contributor

Choose a reason for hiding this comment

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

The indifferent_params feels like it should be a different commit from moving the fiber.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, that's annoying about the indifferent_params. I didn't realise pushing to my master branch would automatically add them to the pull request

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea, anything in that branch will show up. I've found that if you're going to send a pull request it's best to branch it from master first then send a pull for the branch. You can then continue doing stuff in another branch (possibly branched from the pull request branch) but don't do anything in the pull request branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, do you want me to create a feature branch for the Fiber change and issue a new request?

dj2 added a commit that referenced this pull request Jun 22, 2011
Moving Fiber creation up before middleware chain invoked
@dj2 dj2 merged commit ed8d202 into postrank-labs:master Jun 22, 2011
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.

None yet

3 participants