Il giorno 03/mar/2011, alle ore 12.43, luigi scarso ha scritto:

> erlang -> uwsgi  seem to work now also with short names (with latest dev):
> 
> (uwsgierlang@johnII)80> {useless_atom,'uwsginode@johnII'}  ! "Hello!" .
> "Hello!"
> 
> and in the uwsgi terminal
> From: uwsgierlang@johnII To: ��?��ŷC RegName: useless_atom
> eversion: 131
> etype: 107/k esize: 6
> string: Hello!
> 
> I have this callback but it doesn't seem to work;
> 
> def erlang_node_callback (arg):
>    print "received an erlang message"
>    print str(arg)
> uwsgi.erlang_func = erlang_node_callback
> 
> What is wrong ?
> 
> 


Current implementation misses two part (already developed, i only need to clean 
the code a bit).

You can receive 3 kind of messages:

rpc (working)
registered (uncommitted)
unregistered (uncommitted)

rpc uses the uWSGI rpc subsystem

http://projects.unbit.it/uwsgi/wiki/RPC

you define a rpc function in python/lua/perl/ruby then in erlang you simply do

rpc:call(node, 'uwsgi', 'rpc_func_name', [args])

registered works in this way:

def the_erlang_message(message):
     print message

uwsgi.erlang_register_process("pippo", the_erlang_message)

then in erlang

{ 'pippo' , 'node' } ! Message

whenever uWSGI receive a message for process 'pippo' it will call  
the_erlang_message

unregistered are a fallback and they work in the same way of old implementation,
you define a wsgi.erlang_func that will be called for every message.


I hope to commit this last part tomorrow.

--
Roberto De Ioris
http://unbit.it

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

Reply via email to