Signals¶
Attributes¶
REGISTERED_SIGNALS¶
Registered signals.
Functions¶
get_available_num¶
Returns first available signal number.
UwsgiconfException If no signal is available.
get_last_received¶
Get the last signal received.
Classes¶
Signal¶
Represents uWSGI signal.
Warning
If you define a new function in worker1 and register it as a signal handler, only worker1 can run it. The best way to register signals is defining them in the master (.runtime.uwsgi.postfork_hooks.add), so all workers see them.
register_handler¶
-
Where this signal will be delivered to. Default:
worker.1 2 3 4 5 6 7 8 9 10 11 12 13 14
* Mule / Farm object - run on a certain mule or a farm. * ``workers`` - run the signal handler on all the workers * ``workerN`` - run the signal handler only on worker N * ``worker``/``worker0`` - run the signal handler on the first available worker * ``active-workers`` - run the signal handlers on all the active [non-cheaped] workers * ``mules`` - run the signal handler on all the mules * ``muleN`` - run the signal handler on mule N * ``mule``/``mule0`` - run the signal handler on the first available mule * ``spooler`` - run the signal on the first available spooler * ``farmN/farm_XXX`` - run the signal handler in the mule farm N or named XXX * <http://uwsgi.readthedocs.io/en/latest/Signals.html#signals-targets> -
Function to be called after the registration.
Decorator for a function to be used as a signal handler.
send¶
- Remote address.
Sends the signal to master or remote.
When you send a signal, it is copied into the master's queue. The master will then check the signal table and dispatch the messages.
ValueError If remote rejected the signal.
OSError If unable to deliver to remote.
wait¶
Waits for the given of any signal.
Block the process/thread/async core until a signal is received. Use signal_received to get the number of the signal received. If a registered handler handles a signal, signal_wait will be interrupted and the actual handler will handle the signal.
SystemError If something went wrong.