hummingbird-project / hummingbird-lambda

Hummingbird running inside an AWS Lambda
Apache License 2.0
24 stars 3 forks source link

HBLambda.buildResponder #10

Closed adam-fowler closed 10 months ago

adam-fowler commented 10 months ago

Given the variable responder is creating the responder you should probably make this a function. Then given that logic you might as well build the router inside that function as well. I think these changes make it clearer what needs to be done. Also the test lambdas just look cleaner.

I also think we shouldn't ask the user to generate the HBApplicationContext. Some of its members should be coming from the LambdaContext and the thread pool should be set up by us.

Thoughts?

One other thing. I didn't change but I don't think it is necessary to have a generic Encoder and Decoder. They get used as existentials internally in HB.