How to use the uwsgi.register_rpc 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 / rpc.py View on Github external
import uwsgi


def hello():
    return "Hello World"

print(uwsgi.register_rpc("hello", hello))


print(uwsgi.rpc(None, "hello"))
github jaysonsantos / django-uwsgi-mail / test_project / uwsgidecorators.py View on Github external
def __call__(self, f):
        uwsgi.register_rpc(self.name, f)
        return f
github 20tab / upy / uwsgidecorators.py View on Github external
def __call__(self, f):
        uwsgi.register_rpc(self.name, f)
        return f
github galaxyproject / galaxy / scripts / interactivetools / key_type_token_mapping.py View on Github external
# Order by rowid gives us the last row added
            try:
                row = db_conn.execute("select host, port from gxrtproxy where key=? and key_type=? and token=? order by rowid desc limit 1", (key, key_type, token)).fetchone()
                if row:
                    rval = '%s:%s' % (tuple(row))
                    return rval.encode()
                break
            except sqlite3.ProgrammingError:
                db_conn = sqlite3.connect(realtime_db_file)
                continue
            break
    return None


uwsgi.register_rpc('rtt_key_type_token_mapper', key_type_token_mapper)
uwsgi.register_rpc('rtt_key_type_token_mapper_cached', key_type_token_mapper_cached)
github galaxyproject / galaxy / scripts / interactivetools / key_type_token_mapping.py View on Github external
for i in range(2):
            # Order by rowid gives us the last row added
            try:
                row = db_conn.execute("select host, port from gxrtproxy where key=? and key_type=? and token=? order by rowid desc limit 1", (key, key_type, token)).fetchone()
                if row:
                    rval = '%s:%s' % (tuple(row))
                    return rval.encode()
                break
            except sqlite3.ProgrammingError:
                db_conn = sqlite3.connect(realtime_db_file)
                continue
            break
    return None


uwsgi.register_rpc('rtt_key_type_token_mapper', key_type_token_mapper)
uwsgi.register_rpc('rtt_key_type_token_mapper_cached', key_type_token_mapper_cached)
github unbit / uwsgi / uwsgidecorators.py View on Github external
def __call__(self, f):
        uwsgi.register_rpc(self.name, f)
        return f
github unbit / uwsgi / uwsgicc / __init__.py View on Github external
from uwsgicc import app

import uwsgi

def hello_world(name):
    return "Hello World %s" % name

uwsgi.register_rpc("hello", hello_world)

uwsgi.set_warning_message("uWSGI is running the Control Center")

application = app