What would be the right way, according to the Middle-ware paradigm/design pattern to transfer resources (like connections to some IO devices).
It is not part of the Request, and it is definitely not part of the Response.
Is there a third object each Middleware step transfers to the next step in line?
The specifics of my question: I am using PHP a FW called TalisMS (which I have full control over). The resource I need to make global for this specific flow is a socket to an external system I need to fetch data from.
The socket can be to different places, and is decided in the first couple of steps, and then I need to continue use that through the entire flow.
I could make some global resource container, I guess, but I prefer something more Dependency-Injection like.