import vertx
from core.event_bus import EventBus
def handler(msg):
print 'Received message %s' % msg.body
# Now reply to it
msg.reply('Pong!')
EventBus.register_handler('ping-address', handler=handler)
def reply_handler(msg):
print 'Received reply %s' % msg.body
EventBus.send('ping-address', 'ping!', reply_handler)The example above throws following exception. I am running on Mac OSX (Mavericks) with following environment :
Vert.x = 2.1.1, JYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
Traceback (most recent call last):
File "test1.py", line 20, in <module>
File "test1.py", line 2, in f__VertxInternalVert__1
from core.event_bus import EventBus
File "__pyclasspath__/vertx.py", line 26, in <module>
File "__pyclasspath__/core/http.py", line 26, in <module>
File "__pyclasspath__/core/javautils.py", line 23, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.py", line 36, in <module>
BufferType = buffer
NameError: name 'buffer' is not defined
Traceback (most recent call last):
File "test1.py", line 20, in <module>
File "test1.py", line 2, in f__VertxInternalVert__1
from core.event_bus import EventBus
File "__pyclasspath__/vertx.py", line 26, in <module>
File "__pyclasspath__/core/http.py", line 26, in <module>
File "__pyclasspath__/core/javautils.py", line 23, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.py", line 36, in <module>
BufferType = buffer
NameError: name 'buffer' is not definedNoticed: http://bugs.jython.org/issue1521 which seems to be a Jython bug. Any suggestions ? Am I using an incompatible version of Python ?
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
bash-3.2$ cat test1.py; vertx run test1.py
import vertx
from core.event_bus import EventBus
def handler(msg):
print 'Received message %s' % msg.body
# Now reply to it
msg.reply('Pong!')
EventBus.register_handler('ping-address', handler=handler)
def reply_handler(msg):
print 'Received reply %s' % msg.body
EventBus.send('ping-address', 'ping!', reply_handler)
Traceback (most recent call last):
File "test1.py", line 20, in <module>
File "test1.py", line 2, in f__VertxInternalVert__1
from core.event_bus import EventBus
File "__pyclasspath__/vertx.py", line 26, in <module>
File "__pyclasspath__/core/http.py", line 26, in <module>
File "__pyclasspath__/core/javautils.py", line 23, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.py", line 36, in <module>
BufferType = buffer
NameError: name 'buffer' is not defined
Traceback (most recent call last):
File "test1.py", line 20, in <module>
File "test1.py", line 2, in f__VertxInternalVert__1
from core.event_bus import EventBus
File "__pyclasspath__/vertx.py", line 26, in <module>
File "__pyclasspath__/core/http.py", line 26, in <module>
File "__pyclasspath__/core/javautils.py", line 23, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.py", line 36, in <module>
BufferType = buffer
NameError: name 'buffer' is not defined
bash-3.2$