Created
July 9, 2015 10:08
-
-
Save squeaky-pl/b998388de3bc6df7f647 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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