From a062ef2ac252b6085f8e30939d4b62ecdef17659 Mon Sep 17 00:00:00 2001 From: Unbit Date: Sun, 24 Feb 2013 09:45:39 +0100 Subject: [PATCH] added rb tmier in the PSGI plugin --- plugins/psgi/uwsgi_plmodule.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/psgi/uwsgi_plmodule.c b/plugins/psgi/uwsgi_plmodule.c index f8dfbc1e..fe8e4781 100644 --- a/plugins/psgi/uwsgi_plmodule.c +++ b/plugins/psgi/uwsgi_plmodule.c @@ -414,6 +414,23 @@ XS(XS_add_timer) { XSRETURN(1); } +XS(XS_add_rb_timer) { + + dXSARGS; + + psgi_check_args(2); + + uint8_t uwsgi_signal = SvIV(ST(0)); + int seconds = SvIV(ST(1)); + + if (uwsgi_signal_add_rb_timer(uwsgi_signal, seconds, 0)) { + croak("unable to register rb timer"); + XSRETURN_UNDEF; + } + + XSRETURN(1); +} + void init_perl_embedded_module() { @@ -442,5 +459,6 @@ void init_perl_embedded_module() { psgi_xs(atexit); psgi_xs(add_timer); + psgi_xs(add_rb_timer); }