2012/1/11 Łukasz Wróblewski <[email protected]>: > > But if an exception occurs, "after_req" did not perform. > I care to behave, it is the same as request, so in spite of harakiri and > exceptions is preform at the end of worker work.
so essentially you want the hook to run, period, regardless of how the worker ended, yes? instead of endless hooks, what about a uWSGI-specific class of exceptions? eg. `uwsgi.Exception.Harakiri` and whatever else? or an class with a specific interface? or protocol, eg. __main__.__uwsgi_harakiri__, or __main__.__uwsgi_worker_end__? maybe then we can only register a single class/function when an external event occurs, or in the case of protocols, not even need to register anything at all (control moves to the nearest object in the stack implementing the callable). ... i'm not knowledgeable enough about Python impl to know how difficult or possible, but integrating these events/etc with the lang allows flexibility without cluttering uwsgi, *and* potentially allows finer-grained control over which callable actually handles the event (vs. jumping to global function, maybe context/stack can be preserved and/or resumed). thoughts? -- C Anthony _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
