这是我要看的代码。你知道吗
from stomp import *
c = Connection([('127.0.0.1', 62613)])
c.set_listener('print', PrintingListener())
c.start()
在c.set_listener('print', PrintingListener())
中'print'
用于什么?你知道吗
我在这里查了一些文件https://jasonrbriggs.github.io/stomp.py/stomp.html#module-stomp.listener
但未能发现。你知道吗
大多数情况下,我只想确保在那里传递一个空字符串,或者为多个侦听器传递相同的值是可以的。你知道吗
set_listener
中的第一个参数就是侦听器实例的name。以后调用^{name
参数)时,可以使用相同的名称。如果您想在一个连接上设置多个侦听器(即使用不同的名称),那么它也很有用。The documentation指的是这样一句话:要清楚的是,空字符串(即
''
)是一个有效的名称,就像任何其他字符串一样。你知道吗相关问题 更多 >
编程相关推荐