Uh oh!
There was an error while loading. Please reload this page.
Use TerminableInterface - #15
Conversation
jeromemacias
commented
Dec 3, 2014
Waiting for stackphp/CallableHttpKernel#3 to add missing tests. |
davedevelopment
commented
Dec 3, 2014
Do we need to terminate them based on them being matched? I'm not sure, related to stackphp/builder#14 |
jeromemacias
commented
Dec 3, 2014
The goal of UrlMap stack is to manage only one matching app, so I think we should apply the same logic in |
davedevelopment
commented
Dec 3, 2014
But it's one matching app per request, the HttpCache middleware could and would fire multiple requests through the app before terminate happens. |
jeromemacias
commented
Dec 3, 2014
Good point ;) I updated the PR accordingly. |
jeromemacias
commented
Dec 4, 2014
I tested the |
davedevelopment
commented
Dec 4, 2014
Just thought of a really minor thing, perhaps we should keep track of the apps that have been terminated, something like: $terminated = [];
foreach ($this->mapas$path => $app) {
if ($appinstanceof TerminableInterface && !in_array($app, $terminated, true)) {
$app->terminate($request, $response);
$terminated[] = $app;
}
}Not sure if that would be overkill. I personally think terminate should be idempotent, so shouldn't matter. |
davedevelopment
commented
Dec 4, 2014
CHH
commented
Apr 16, 2015
Thanks! |

Add
UrlMap::terminate()method.