How to use the uwsgi.signal function in uWSGI

To help you get started, we’ve selected a few uWSGI examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unbit / uwsgi / tests / sigwait.py View on Github external
def application(e, s):
    s('200 OK', [('Content-Type', 'text/html')])
    if e['PATH_INFO'] == '/30':
        uwsgi.signal(30)
        uwsgi.signal(100)
    else:
        uwsgi.signal(17)
    return "Signal raised"
github unbit / uwsgi / tests / testsignals.py View on Github external
import uwsgi

# send a raw signal to register with file_monitor subsystem
# uwsgi.signal(10, "/tmp/topolino")
uwsgi.signal(10, "/tmp")
# uwsgi.signal(10, "/root")

# send a raw signal to register with timer subsystem
uwsgi.signal(11, "3")
uwsgi.signal(11, "4")
uwsgi.signal(11, "8")


def application(e, s):
        s('200 Ok', [('Content-Type', 'text/html')])
        return "<h1>Hello World</h1>"
github unbit / uwsgi / tests / runningthread.py View on Github external
def mess():
    while True:
        for i in xrange(0, 100):
            if uwsgi.ready():
                uwsgi.signal(17)
            print(i)
            time.sleep(0.1)
github unbit / uwsgi / tests / sigwait.py View on Github external
def application(e, s):
    s('200 OK', [('Content-Type', 'text/html')])
    if e['PATH_INFO'] == '/30':
        uwsgi.signal(30)
        uwsgi.signal(100)
    else:
        uwsgi.signal(17)
    return "Signal raised"
github unbit / uwsgi / tests / testsignals.py View on Github external
import uwsgi

# send a raw signal to register with file_monitor subsystem
# uwsgi.signal(10, "/tmp/topolino")
uwsgi.signal(10, "/tmp")
# uwsgi.signal(10, "/root")

# send a raw signal to register with timer subsystem
uwsgi.signal(11, "3")
uwsgi.signal(11, "4")
uwsgi.signal(11, "8")


def application(e, s):
        s('200 Ok', [('Content-Type', 'text/html')])
        return "<h1>Hello World</h1>"
github unbit / uwsgi / tests / ugevent.py View on Github external
def bg_task():
    for i in range(1, 10):
        print "background task", i
        gevent.sleep(1)

    # task ended raise a signal !!!
    uwsgi.signal(17)
github unbit / uwsgi / tests / testsignals.py View on Github external
import uwsgi

# send a raw signal to register with file_monitor subsystem
# uwsgi.signal(10, "/tmp/topolino")
uwsgi.signal(10, "/tmp")
# uwsgi.signal(10, "/root")

# send a raw signal to register with timer subsystem
uwsgi.signal(11, "3")
uwsgi.signal(11, "4")
uwsgi.signal(11, "8")


def application(e, s):
        s('200 Ok', [('Content-Type', 'text/html')])
        return "<h1>Hello World</h1>"
github unbit / uwsgi / uwsgicc / uwsgicc.py View on Github external
def sig():
    try:
        uwsgi.signal(int(request.form['signum']))
        flash("uwsgi signal sent")
    except:
        flash("unable to send signal")
    return redirect(url_for('index'))
github unbit / uwsgi / t / python / spooler_decorators / spooler_handlers.py View on Github external
def controlled_arguments_task(*args, **kwargs):
    if args != ({'key': 'value'}, 2) or kwargs != {'key1': 'value1'}:
        print("We have a problem!")
        open(ghostpath, 'w').close()
    uwsgi.signal(20)