> ----- Oryginalna wiadomość -----
>> Od: "Roberto De Ioris" <[email protected]>
>> Do: "uWSGI developers and users list" <[email protected]>
>> Wysłane: wtorek, 10 styczeń 2012 19:50:58
>> Temat: Re: [uWSGI] after req hook
>>
>> Hi, if i understand correctly you need a way to have only a part of
>> your
>> code running without harakiri ?
>
>
> Hi.
> Not only without harakiri. After each request.
> And if during the request occurs harakiri or other execution, this
> additional part of the code should be done.
>
> eg.
>
>
> import os
> import uwsgi
> import trac.web.main
>
> os.environ['TRAC_ENV'] = '<absolute_path_to_trac_project>'
> applications = {'/trac':trac.web.main.dispatch_request}
>
> def after_req(id):
>   print('This part is executed after every request no matter what
> (execution, harakiri, etc.).')
>
> uwsgi.after_req_hook = after_req
>
>
>

The plugin system already has an after_request entry point, so i can
implement that with 3-4 lines of code.

The only problem is in what to pass as argument (the one you have
specified as 'id' in your example)


-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to