DASPRiD / Dash

Flexible PSR-7 compliant HTTP router
BSD 2-Clause "Simplified" License
29 stars 9 forks source link

HTTP only? #65

Closed Thinkscape closed 8 years ago

Thinkscape commented 8 years ago

It seems that Dash is limited to HTTP only. That will screw up how we might write actions that work with other types of requests (i.e. console, worker, non-http RPC, deferred, etc.)

At the very least it should be clear, that it's a http-only thing and not "zf3 router"... but then the question is how are other types of requests routed (separate router?), how can we type-hint or consume other types of requests etc.

DASPRiD commented 8 years ago

ZF handles console routing via Zend\Console directly for some time now (the router part is only left for BC reasons). Apart from that, ZF's router never supported non-http RPC or anything like that, let alone that anyone ever had a use-case for that.

Thinkscape commented 8 years ago

It's not about zf router supporting that in the past, it's about being able to add those in (extensibility of the mvc if you like).

DASPRiD commented 8 years ago

There's no reason to make the router way more complicated for something which doesn't even nearly fall into the 80/20 case. So far, no single request ever popped up in neither ZF nor here to have something like that supported. In the rare case someone has such an application, there are always other ways to handle that in your application, like by overriding the route event.

Thinkscape commented 8 years ago

What I'm looking after is clear ways of extension. You've peppered Dash with managers/loaders all over the place - so you're trying to make it extensible.

At the same time, it's hard-coded to only support request-response http...

There needs to be an easy way to handle http request sub-classes (i.e. SOAP requests, JSONRPC requests etc.) and other types of request. If I wanted to add a theoretical "thrift rpc router", which does not use HTTP requests, is there a common request class (message class for example), how does it tie into zf3 mvc, how can I support actions that work with multiple types of requests etc.

DASPRiD commented 8 years ago

As I said, if you want to handle non-HTTP requests, you can always override the route-event to handle something different. Dash is specifically build to handle PSR-7.

Thinkscape commented 8 years ago

You've related to 10% of my last comment. What about the rest ? :-)

DASPRiD commented 8 years ago

Your entire comment was about non-HTTP requests, which I addressed, that's more like 100% ;)

Thinkscape commented 8 years ago

There needs to be an easy way to handle http request sub-classes (i.e. SOAP requests, JSONRPC requests etc.)

DASPRiD commented 8 years ago

Those requests are already handled by Zend\Soap\Server and the like.

Thinkscape commented 8 years ago

sigh... not really listening to me ... I guess I'll just port the zf2 router or something... sigh