> Hi guys,
> Just read the 'per core harakiri features' on 2.1 brunch. Thank you guys.
> I had  few questions on interprocess communications error message/info:
> rpc server Configs :
> socket = 127.0.0.1:3031http-socket = 127.0.0.1:8005max-requests = 5000
> rpc client Configs : http-socket = 127.0.0.1:8000max-requests = 5000
> 1. Rpc error message :
> client rpc code:
> import uwsgireturn uwsgi.rpc('127.0.0.1:{0}'.format(3031), 'foo')
> server rpc code: @rpc('foo')def foobar():     print 'I am foobar'
> - error : invalid request ( current strsize: 29285). skip
> I don't understand why.

rpc only works via uwsgi sockets, not http. You can bind to both without
problems:

; for http
http-socket = :9091
; for rpc
socket = :9092

>
> 2. uwsgi.send_message
> client code :uwsgi.send_message(receiver, 17, 0, { }, 5)
> AttributeError: module object has no attribute 'send_message'
> Was this deprecated? I find this function handy in some cases.
> 3.  I read this :
> http://uwsgi-docs.readthedocs.org/en/latest/Spooler.html
> but still didn't understand how to network spool functions in python.Do
> you have a an example. Went through the github code, some mailing listbut
> i had no luck.
> Sorry for asking a lot questions.
> Thanks,
> Richard

the policy is avoiding to extend the api with functions that could be
written in the native language without effort:

import struct

d = {'foo':'bar', 'test':'test2'}

pkt_payload = ''

for key,value in d.items():
    pkt_payload += struct.pack('<H', len(key))
    pkt_payload += key
    pkt_payload += struct.pack('<H', len(value))
    pkt_payload += value

pkt_header = chr(17) + struct.pack('<H', len(pkt_payload)) + chr(0)

full_pkt = pkt_header + pkt_payload

# now send full_pkt to the spooler server socket as is ...

the Net::uwsgi perl module is an example of this approach


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

Reply via email to