Sorry about the delay.

On Wed, 4 Sep 2013 15:00:36 +0900
Satoshi Kobayashi <[email protected]> wrote:

> Currently, HTTP Routing and implementations are separated on a WSGI
> application. However, I like that they are in the same place. For example,
> they are Flask of Python, and Bottle and JAX-RS of Java.
> 
> Then, I would like to propose the following API which based on decorator.
> 
> ----------8<----------8<----------
> class SampleController(ControllerBase):
> 
>     @route('sample', '/sample/{dpid}',
>            methods=['GET'], requirements={'dpid': dpidlib.DPID_PATTERN})
>     def sample(self, req, dpid, **_kwargs):
>         return Response(status=200, body=dpid)
> ----------8<----------8<----------
> 
> Then, RyuApp subclass registers the controller for WSGIApplication.
> 
> ----------8<----------8<----------
> class NewWsgiApiApp(app_manager.RyuApp):
>     _CONTEXTS = {
>         'wsgi': WSGIApplication,
>     }
> 
>     def __init__(self, *args, **kwargs):
>         super(NewWsgiApiApp, self).__init__(*args, **kwargs)
> 
>         wsgi = kwargs['wsgi']
>         wsgi.register(SampleController)
> ----------8<----------8<----------
> 
> Moreover, it keeps backward compatibility.
> 
> How you do you feel about it? I have already written PoC patch and attach
> to this mail.

Looks reasonable. I like this. Can you send a patch?


Thanks,

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to