> Hello
>
> I'm trying to use an external rpc client (RPyC) to make rpc calls to a
> uwsgi app I have running with, but I'm not having much luck getting it to
> work.  I'm trying to do this with clients that don't have the ability to
> import uwsgi or uwsgidecorators as they aren't running as under uwsgi.
>
> My server code looks as:
>
> 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
>
> with my simple RPyC client code as
>
> import rpyc
> c = rpyc.connect('127.0.0.1', port=3737)
> c.sync_request('testing_call')
>
> But all I get back is Connection reset by peer from RPyC and the uwsgi app
> gives:
> 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)
>
>
>
>

the uWSGI rpc subsystem is meant to be used only by uWSGI instances. Each
RPC tecnhology works on top of its protocol, so if you want to expose
uWSGI rpc function via another protocol you have to build a wrapper.

Albeit uWSGI RPC is very fast, once you wrap it you loose lots of its
advantages, so to build a public api it is better to use a 'public' rpc
subsystem (read: use rpyc for the server part too)


-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to