CrowdHailer / raxx

Interface for HTTP webservers, frameworks and clients
https://hexdocs.pm/raxx
Apache License 2.0
400 stars 29 forks source link

Add Raxx.Context #159

Closed nietaki closed 5 years ago

nietaki commented 5 years ago

Should close #156.

I think it's mostly in line with the discussion from the related issue. For now the context is implicit even for the middlewares, but that could be changed in the future. There are mechanisms for passing the context between processes.

Note: I intentionally didn't use function names from the Map module (get, put, update), but instead opted for new ones, to avoid confusion and potentially save them for more appropriate use-cases (like manipulating the explicit context struct). Happy to discuss it.

At the beginning I was drawn towards overcomplicating the interface with many more context section helpers, but I think the interface I came up with there is simple and powerful enough (and easy to implement additional things on top of)

Remaining work (edited, after discussions)

nietaki commented 5 years ago

I think this is basically done. I'm still not sure about some names Raxx.Context.ServerContext is a mouthful, for example.

CrowdHailer commented 5 years ago

Also need to add a CHANGELOG entry on the checklist

nietaki commented 5 years ago

I always forget about CHANGELOG!

I'll learn one day...