Merge: Popcorn: use_before, use_after
authorJean Privat <jean@pryen.org>
Thu, 26 May 2016 15:43:35 +0000 (11:43 -0400)
committerJean Privat <jean@pryen.org>
Thu, 26 May 2016 15:43:35 +0000 (11:43 -0400)
commit263b33b7966567720a9957324f996fe73d42d3dc
tree1fed61321702de15826143a7db4a4b161abdb2c1
parent050d6399fe900bc85b96f1ae567b24937233b0ed
parent63711ad964c7974878bcce2c606fff306645ae39
Merge: Popcorn: use_before, use_after

This PR introduce two changes in the popcorn request-response cycle:
* Introduce placeholders `use_before` and `use_after` to force handler execution before or after each request. This makes the life of developer easier when using a lot of routers/routers.
* Break response cycle if a between (between as between before and after) handler gives a response then call after_handler. This encourage the use of middleware into `use_before` and `use_after` and avoid requests sent twice. Bonus the api makes more sense like this.

Pull-Request: #2125
Reviewed-by: Jean Privat <jean@pryen.org>