If it's py3 maybe you need to uwsgi.call(b'test') ??

2014/1/1 Łukasz Wróblewski <[email protected]>

> Hi,
>
> I just installed version 2.0 and I wanted to try the RPC.
> Python 3.2.3
> What am I doing wrong?
>
>
> "
> import uwsgi
>
> def test(): print('TEST')
> uwsgi.register_rpc("test", test)
>
> def application(environ, start_response):
>    uwsgi.call('test')
>    start_response('200 OK', [('Content-Type', 'text/html; charset=utf-8')])
>    yield b'ok'
>
> "
>
> Wed Jan  1 14:20:20 2014 - *** Starting uWSGI 2.0 (32bit) on [Wed Jan  1
> 14:20:20 2014] ***
> Wed Jan  1 14:20:20 2014 - compiled with version: 4.7.2 on 01 January 2014
> 03:47:16
> Wed Jan  1 14:20:20 2014 - os: Linux-3.4.43+ #1 PREEMPT Mon Aug 19
> 15:35:54 CST 2013
> Wed Jan  1 14:20:20 2014 - nodename: cubieboard
> Wed Jan  1 14:20:20 2014 - machine: armv7l
> Wed Jan  1 14:20:20 2014 - clock source: unix
> Wed Jan  1 14:20:20 2014 - pcre jit disabled
> Wed Jan  1 14:20:20 2014 - detected number of CPU cores: 1
> Wed Jan  1 14:20:20 2014 - current working directory: /mnt/filmy/app
> Wed Jan  1 14:20:20 2014 - detected binary path: /usr/bin/uwsgi
> Wed Jan  1 14:20:20 2014 - *** WARNING: you are running uWSGI without its
> master process manager ***
> Wed Jan  1 14:20:20 2014 - your processes number limit is 6458
> Wed Jan  1 14:20:20 2014 - your memory page size is 4096 bytes
> Wed Jan  1 14:20:20 2014 - detected max file descriptor number: 1024
> Wed Jan  1 14:20:20 2014 - lock engine: pthread robust mutexes
> Wed Jan  1 14:20:20 2014 - thunder lock: disabled (you can enable it with
> --thunder-lock)
> Wed Jan  1 14:20:20 2014 - uWSGI http bound on :8080 fd 4
> Wed Jan  1 14:20:20 2014 - spawned uWSGI http 1 (pid: 1587)
> Wed Jan  1 14:20:20 2014 - uwsgi socket 0 bound to TCP address
> 127.0.0.1:36291 (port auto-assigned) fd 3
> Wed Jan  1 14:20:20 2014 - Python version: 3.2.3 (default, Sep 30 2012,
> 17:54:29)  [GCC 4.7.2]
> Wed Jan  1 14:20:20 2014 - *** Python threads support is disabled. You can
> enable it with --enable-threads ***
> Wed Jan  1 14:20:20 2014 - Python main interpreter initialized at 0x12f9398
> Wed Jan  1 14:20:20 2014 - your server socket listen backlog is limited to
> 100 connections
> Wed Jan  1 14:20:20 2014 - your mercy for graceful operations on workers
> is 60 seconds
> Wed Jan  1 14:20:20 2014 - mapped 90152 bytes (88 KB) for 1 cores
> Wed Jan  1 14:20:20 2014 - *** Operational MODE: single process ***
> Wed Jan  1 14:20:21 2014 - registered shared/inherited RPC function "test"
> Wed Jan  1 14:20:21 2014 - WSGI app 0 (mountpoint='') ready in 1 seconds
> on interpreter 0x12f9398 pid: 1586 (default app)
> Wed Jan  1 14:20:21 2014 - spawned uWSGI worker 1 (and the only) (pid:
> 1586, cores: 1)
> Traceback (most recent call last):
>   File "./app.py", line 72, in application
>     uwsgi.call('test')
> ValueError: unable to call rpc function
> [pid: 1586|app: 0|req: 3/3] 10.0.0.15 () {36 vars in 621 bytes} [Wed Jan
>  1 14:20:30 2014] GET /...
>
>
>
> --
> Łukasz Wróblewski
> http://www.nri.pl/ - Nowoczesne Rozwiązania Internetowe
> http://www.hostowisko.pl/ - Profesjonalny i tani hosting
> http://www.katalog-polskich-firm.pl/ - Najlepszy darmowy katalog firm
>
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
>


-- 
Łukasz Mierzwa
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to