Skip to content

Instantly share code, notes, and snippets.

@squeaky-pl
Created July 9, 2015 10:08
Show Gist options
  • Save squeaky-pl/b998388de3bc6df7f647 to your computer and use it in GitHub Desktop.
Save squeaky-pl/b998388de3bc6df7f647 to your computer and use it in GitHub Desktop.
import uwsgi
def hello_world():
return "Hello World"
uwsgi.register_rpc("hello", hello_world)
print(uwsgi.rpc(None, "hello"))
print(uwsgi.call("hello"))
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
print(uwsgi.rpc(None, "hello"))
print(uwsgi.call("hello"))
return [b'Hello']
uwsgi --http localhost:9090 --wsgi-file test_rpc.py
Everything works on Python 2
When i tried inside Python3 virtualenv
I get this:
registered shared/inherited RPC function "hello"
Traceback (most recent call last):
File "test_rpc.py", line 8, in <module>
print(uwsgi.rpc(None, "hello"))
ValueError: unable to call rpc function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment