Re: [rpyc] RPyC and uwsgi

122 views
Skip to first unread message

Tomer Filiba

unread,
Apr 13, 2013, 3:56:54 AM4/13/13
to rpyc
what is "sync_connect"? and why would you connect an rpyc client to a WSGI server? it's not the different protocols. you can use requests/urllib to consume HTTP services.
what has rpyc even to do with it?

-tomer

-----------------------------------------------------------------
    
Tomer Filiba 
tomerfiliba.com        


On Sat, Apr 13, 2013 at 3:53 AM, Luke Powers <luke....@openx.com> wrote:
Hello

Anyone have any experience connecting to a uwsgi app with RPyC?  I'm currently unable to connect using uwsgi as it expects to be run inside of an instance with uwsgi imported (ie a uwsgi app).

I have the following rpc server:

import simplejson as json
from uwsgidecorators import rpc                                          
import uwsgi                                                             
                                                                         
@rpc('testing_call')                                                             
def testing_call(test_param):                                                  
    print 'got a call'                                                   
    return json.dumps({'test_param':test_param})

#Run with
#/opt/bin/uwsgi --import uwsgi_rpc_test -s :3737 -M  --enable-threads -p 1

But I am unable to connect to this app with RPyC with any connection method.

import rpyc
c = rypc.connect('127.0.0.1', port=3737)
c.sync_connect('testing_call')

This code just generates the following error from RPyC:
EOFError: [Errno 104] Connection reset by peer

And the following error message from the uwsgi app:
Empty python request. skip.
[pid: 9468|app: -1|req: -1/3]  () {0 vars in 0 bytes} [Fri Apr 12 17:51:27 2013]   => generated 0 bytes in 0 msecs ( 0) 0 headers in 0 bytes (0 switches on core 0)


Anyone have some advice?
Thanks

--
 
---
You received this message because you are subscribed to the Google Groups "rpyc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rpyc+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Luke Powers

unread,
Apr 15, 2013, 1:44:52 PM4/15/13
to rp...@googlegroups.com
Woops, typed that wrong, it should be

c.sync_request('testing_call')

uWSGI is just the server we're using.  It has the ability to serve rpc apps as well as wsgi apps.  The current rpc services are used by other uWSGI apps, but the problem is that uWSGI requires other uWSGI modules be imported to get the rpc services to work, which we don't want for the few small utility apps we're using.  The idea was to (hopefully) use rpyc to connect to the uWSGI rpc app without importing the rest of the uWSGI overhead.
Reply all
Reply to author
Forward
0 new messages