Hi there,
I'm kind of migrating an app where a backend runs on an OlinuXino Lime from v1 to v2. Migrating is not the correct term since I'm reimplementing everything. The OlinuXino talks via UART to an ATmega328, basically functions as a LED dimmer. There the WAMPServerProtocol registers a self.registerForRpc(self.factory.SerialProtocolInstance, "
http://example.com/mcu-control#"), where the SerialProtocolInstance has a method decorated with @exportRpc("sendSerial"). This sendSerial recieves RPC calls from clients and forwards the data to the ATmega328, but it also does a self.wamp.dispatch("
http://example.com/mcu#data", { 'line': line.replace('\n', '') }, exclude=[]) in order to sync all connected clients. Works as smooth as butter.
The new version of the backend subscribes to a topic, and the data for the ATmega328 arrives at that topic. In the topic handler I do three calls
self.serialProtocol.lineSend(line)
self.publish('com.myapp.mcu.event', {'hostname': bc.hostname, 'from': 'self', 'line': line, 'reflected': data['reflect']}, options = PublishOptions(acknowledge = True, discloseMe = True, excludeMe = False, eligible = [details.publisher]))
self.publish('com.myapp.mcu.event', {'hostname': bc.hostname, 'from': 'other', 'line': line, 'reflected': data['reflect']}, options = PublishOptions(acknowledge = True, discloseMe = True, excludeMe = False, exclude = [details.publisher]))
My problem is that v2's performance is extremly sluggish. v1 is smooth, as realtime as it gets. v2 not at all, unless I comment out the two self.publish(...) calls, or just one of them, which only halves the problem, but it's still as bad as a no-go gets.
Any idea what could be causing this?