>>
>> Hi Luigi, can you post your command line and uWSGI logs ?
> Sorry for delay (I cannot access the machines after 18:00)
>
> The machine has  name johnII; this is the python part
>
> ## erlang-recmsg.py
> import uwsgi
> def erman(arg):
>     print "received an erlang message"
>     print arg
>
> uwsgi.erlang_func = erman
>
>
> $> uwsgi -s 127.0.0.1:38079  --erlang uwsginode@johnII --erlang-cookie
> cookie_dispatcher -p 2 -w erlang-recmsg
> *** Starting uWSGI 0.9.6.7 (32bit) on [Thu Feb  3 09:28:05 2011] ***
> compiled with version: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
> Python version: 2.6.5 (r265:79063, Jan 19 2011, 17:44:48)  [GCC 4.2.4
> (Ubuntu 4.2.4-1ubuntu3)]
> uWSGI running as root, you can use --uid/--gid/--chroot options
>  *** WARNING: you are running uWSGI without its master process manager ***
> your memory page size is 4096 bytes
> allocated 412 bytes (0 KB) for 1 request's buffer.
> binding on TCP port: 38079
> your server socket listen backlog is limited to 100 connections
> initializing hooks...done.
> Erlang C-Node initialized on port 44463 you can access it with name
> uwsginode@johnII
> ...getting the applications list from the 'erlang-recmsg' module...
> uwsgi.applications dictionary is not defined, trying with the
> "applications" one...
> applications dictionary is not defined, trying with the "application"
> callable.
> static applications not defined, you have to use the dynamic one...
> spawned uWSGI worker 1 (pid: 30326)
> Erlang mode enabled for worker 2.
> spawned uWSGI worker 2 (pid: 30327)
>
>
> The erlang part
> $> erl -sname uwsgierlang -setcookie cookie_dispatche
>
> From here I still have not any  clue on how to send a message from
> 'uwsgierlang@johnII' to
> 'uwsginode@johnII'  --- I think I missed some piece here and there.
>
> Sending messages to erlang nodes works fine.
>


Sadly 0.9.6.7 introduced a bug, open erlang.c and in erlang_loop()
add

wsgi_req_setup(wsgi_req, 0);


soon after the

while (uwsgi.workers[uwsgi.mywid].manage_next_request) {

line

Then in erlang shell:

{ pippo, 'uwsginode@ip' } ! "ciao".

The first one should be the pid but in 0.9.6 is ignored by uWSGI
(in 0.9.7-dev can have different meaning).

A couple of notes:

There is a design error in 0.9.5.x and 0.9.6.x for elang communication.
The doc assumes that each node is directly connected and for each message
you have to open a connection.

This is completely wrong as connection is with epmd that act as a router
for every message.

Pratically this is a no issue for development, but performance will hurt a
bit.

Another error is forcing user to dns/ip nodename. This will be useless in
the next release. (and you can name node as you wish)

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

Reply via email to