We have a uwsgi python app that is _not_ thread-safe, so we run with uwsgi
config enabled-threads=0 and threads=0.
We need to invoke a python function periodically on each worker when that
worker is idle (to update some expensive state).
We run many worker processes.
I have two proposals for do this, but not sure if they would work:
- Use the uwsgi cron functionality, but it only runs in the master and I don't
know if there is a way for the master to enumerate its idle workers and then
call a function in those idle workers.
- Use --idle to send a signal when a worker is idle. I cannot find enough
documentation on --idle and stop_sgnal.
I think my request is very similar to what's in the archives at
http://lists.unbit.it/pipermail/uwsgi/2014-November/007765.html
<http://lists.unbit.it/pipermail/uwsgi/2014-November/007765.html>
wanting a "register_idle_handler" function, though I don't know if my
no-threads needs would be met.
Thanks,
--
David Waitzman
_______________________________________________
uWSGI mailing list
uWSGI@lists.unbit.it
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi