On Friday, March 24, 2017 at 4:38:34 PM UTC+1, Rivera, John wrote:
>
> I think the current middleware proposal is conceptually very close to 
> continuations (https://en.wikipedia.org/wiki/Continuation).
>

While this is true for almost all middlewares I'm aware of this is not true 
for the current proposal.

The issue is that continuations are *invoked/called* (e.g. call/cc 
<https://en.wikipedia.org/wiki/Call-with-current-continuation>) and 
Continuation-passing 
style <https://en.wikipedia.org/wiki/Continuation-passing_style> is a 
functional programming style. Unfortunately, Woody and others want to 
design Middlewares without `__invoke` interfaces by all means; thus we have:

interface DelegateInterface
{
    /**
     * Dispatch the next available middleware and return the response.
     *
     * @param ServerRequestInterface $request
     *
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request);
}

Hence, the `$delegate->process($request)` means (see Why the term 
"delegate"? 
<https://github.com/php-fig/fig-standards/blob/master/proposed/http-middleware/middleware-meta.md#why-the-term-delegate>
):

the delegate processes the request for the original middleware in order to 
> return a response.


Therefore, they are conceptually distinct for ideological reasons.

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/8ee837f9-a613-4650-93fe-5ada71e004e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to