Re: [Vala] Unified Server Gateway Interface (RFC)




On 01/18/2012 11:51 PM, Denis Kuzmenok wrote:

Can you show some helpful example of use?

The code is not yet written so no examples yet.

The goal of this standartization is stackable apps/middleware:

   Request   Response
      |         |
    (App1)   (App1)
      |         |
     ...       ...
      |         |
    (AppN)   (AppN)
      \......../


First column is Request processing and second is Resposne processing.

In this scheme App #1 may perform Etag generation, App #2
may handle HTTP authentication App #3 may perform request
logging and so on. App = Middleware in this case. Each app
may stop the chain and return response if needed. This way
each VSGI conforming App may be dropped in your VSGI app
and reused consistently.

This allows us to mount modules on different urls as (pseudocode):

app.mount('/login', AuthenticationApp)
app.mount('/forum', ForumApp)
app.use(CookieSessionStore)
app.use(HttpCaching)

Also. It should be possible to mout VSGI middleware/apps into existing
python/ruby/javascript apps with thin integration for JSGI, Rack and WSGI.

As initial proposal (different from README) think the VSGI app should
look like this:

interface VSGI.App {
    public virtual void process_request(Request req)
    public virtual void process_response(Response res)
}

var apps = new ArrayList<VSGI.App>();

var req = new VSGI.Request()

foreach (app in apps) {
   app.process_request (req);
}

var res = new VSGI.Response()

foreach (app in apps.reverse()) {
   app.process_response(res)
}

In each case Request and Response are adapter specific
but work consistently for CGI, FastCGI, uWSGI, SCGI and Soup.


Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]