Il 22/09/2012 16:49, Roberto De Ioris ha scritto:

Hello,

Il 22/09/2012 16:01, Roberto De Ioris ha scritto:

Any plans or roadmap for 1.4?


Currently only one thing:

- alarm framework, trigger an alarm (plugin-based, like mail, signal,
xmpp...) when particular log messages are spit out or via the
uwsgi.alarm("alarm_id", "message") api function

[uwsgi]
alarm = foobar1 xmpp:[email protected]/Office
alarm = foobar2 mail:[email protected]
log-alarm = foobar1,foobar2 .*DANGER cache is FULL.*
log-alarm = foobar2 ^Traceback

this will define 2 kind of alarms (foobar1 and foobar2)

Both will be triggered when the uWSGI cache is full

foobar2 will be triggered whenever a Traceback is generated.

That sounds great from a sysadmin point of view :) but for the poor
programmer would be possible to add alarm handlers from the uwsgi python
module? e.g for the cache is full message i don't need to get a mail i
just want to call a function that does some cache cleanup :)


Well, you will use a signal for that:

[uwsgi]
alarm = cachefull signal:100
log-alarm = cachefull .*CACHE IS FULL.*


@signal(100)
def clean_the_cache(signum):
     pass


Cool, will do that then.

thanks,
riccardo
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to