swift-server / swift-aws-lambda-runtime

Swift implementation of AWS Lambda Runtime
Apache License 2.0
1.13k stars 102 forks source link

[RFC] Adopts *Writable* BaggageContext (Better) #167

Closed ktoso closed 7 months ago

ktoso commented 3 years ago

This adopts the baggage API in the shape of https://github.com/slashmo/gsoc-swift-baggage-context/pull/34

I have discussed with @fabianfett and @tomerd a little bit about this.


This adoption is preferable I believe, because of comments that @adam-fowler raised in https://github.com/slashmo/gsoc-swift-baggage-context/pull/34#discussion_r488416689 In general, this means is also ready for the Context requiring a set/get on the baggage, making lifes easier for other folks.

Specifically, we talked with @fabianfett why the Lambda.Context context type was a class -- since it was immutable, it avoided copying around things a lot. We can achieve the same niceness by making it a CoW type, rather than just a struct. It's a bit of work but worth it in the long run as we get the best of both worlds.

ktoso commented 3 years ago

Whoop I PRed from master based branc... fixing

tomerd commented 7 months ago

closing in inactive PRs, feel free to re-open if still relevant