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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lambda handler #1337

Closed
wants to merge 1 commit into from

Conversation

@timoschilling
Copy link
Contributor

commented Jan 29, 2019

This handler allows it to run a Rack app inside a AWS Lambda.

This is currently only an PR proposal, if it's gets a 馃憤, I will add some specs and some docs.

@timoschilling timoschilling force-pushed the timoschilling:lambda-handler branch 2 times, most recently from 5809826 to aa92eec Jan 29, 2019

lib/rack/handler/lambda.rb Outdated Show resolved Hide resolved

@timoschilling timoschilling force-pushed the timoschilling:lambda-handler branch from aa92eec to 02077b6 Jan 30, 2019

@tenderlove

This comment has been minimized.

Copy link
Member

commented Feb 3, 2019

I've never used AWS lambda, so I don't really understand this code. I can read it and see what it does, but no idea how to use this with AWS lambda so I can't really comment on it. Any reason for adding this to Rack rather than making a gem? I'm not against adding it necessarily, just curious if there's a reason to put it in core.

Thanks!

@HoneyryderChuck

This comment has been minimized.

Copy link

commented Feb 5, 2019

just for the sake of documentation a serverless rack plugin already exists. I don't know what rack itself gains of shipping with a lambda adapter though.

@timoschilling

This comment has been minimized.

Copy link
Contributor Author

commented Feb 5, 2019

@tenderlove I think the same reason why rack has handlers for puma, unicorn and co.

@tenderlove

This comment has been minimized.

Copy link
Member

commented Feb 5, 2019

@tenderlove I think the same reason why rack has handlers for puma, unicorn and co.

Rack doesn't actually have handlers for Puma or Unicorn, they're defined in the webserver gems themselves. The list of build-in handlers is here.

I'm not opposed to putting handlers in Rack itself, but I think it's better to be put in a gem because

  1. I don't use AWS lambda, so if there's a bug I don't think I'll be a good person to fix it
  2. If there is a bug it won't get released until there is a Rack release (I don't release Rack that often)
  3. Development speed will have to match Rack's development speed

This is why the popular web servers don't ship handlers in Rack. Given there's already a serverless Rack solution, maybe adding an implementation as an example would be better.

What do you think?

@timoschilling

This comment has been minimized.

Copy link
Contributor Author

commented Feb 5, 2019

@tenderlove I think the same reason why rack has handlers for puma, unicorn and co.

Rack doesn't actually have handlers for Puma or Unicorn, they're defined in the webserver gems themselves. The list of build-in handlers is here.

Sorry I listed the wrong handlers 馃う鈥嶁檪锔

Ok, I will move it into a separate gem.

@timoschilling timoschilling deleted the timoschilling:lambda-handler branch Feb 5, 2019

@metaskills metaskills referenced this pull request Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can鈥檛 perform that action at this time.