Description
Description
I've just noticed that a new Http client was merged into Symfony thanks to @jderusse & @weaverryan (kuddos btw).
I've worked on Resilient applications the last two years while improving the PrestaShop CMS in my previous job and I've end up
creating our very own library that implements the Circuit Breaker design pattern: https://github.com/loveOSS/resiliency.
This design pattern decorates any (HTTP) client and implements 2 patterns:
- the Retry pattern;
- the Fallback pattern;
Can we imagine the declaration of a class (or an event ?) that could have the responsibility to return a response if the server is unavailable ?
This way, every Symfony (HTTP-dependent) application could be resilient by design.
Example
I'm not sure about the implementation it should have into Symfony, but this is how it works in Resiliency and in most of non PHP libraries that provide this kind of features.
Thanks for your time !
And feel free to close it if it's out of the scope of the framework/component.