def rpc(): node = str(request.form['node']) fargs = str(request.form['args']) args = fargs.split() if len(args) > 0: ret = uwsgi.rpc(str(node), str(request.form['func']), *map(str, args)) else: ret = uwsgi.rpc(str(node), str(request.form['func'])) #flash("rpc \"%s\" returned: %s" % (request.form['func'], ret) ) return ret
def application(env, start_response): start_response('200 Ok', [('Content-Type', 'text/html')]) return uwsgi.rpc('127.0.0.1:3031', 'hello')
def helloapp(env, start_response): start_response('200 Ok', [('Content-Type', 'text/html')]) return uwsgi.rpc('127.0.0.1:3031', 'hello')
import uwsgi def hello(): return "Hello World" print uwsgi.register_rpc("hello", hello) print uwsgi.rpc(None, "hello")
import uwsgi def hello(): return "Hello World" print(uwsgi.register_rpc("hello", hello)) print(uwsgi.rpc(None, "hello"))
def rpc(self, endpoint, func, *params): return uwsgi.rpc(endpoint, func, *params)