Registering RPC using @wamp.register

#1

Hi,

Currently I am registering my RPC progressive call using below:

yield self.register(self.test,u’com.test.test’,RegisterOptions(details_arg=‘testDetails’,invoke=u’roundrobin’)).

I am trying to see if I can achieve the same using annotation @wamp.register. But @wamp.register is taking only one argument. How can I give ResgiterOptions if I want to register using @wamp.register.

Here is my code:

@wamp.register(u’com.test.test’)

@inlineCallbacks

def test(n,testString,testDetails=None):

if testDetails.progress:

caller can (and requested to) consume progressive results

for i in range(n):

testDetails.progress(testString+" "+str(i))

yield sleep(1)

else:

process like a normal call (not producing progressive results)

yield sleep(10)

returnValue(n)

Thanks,

Chaitanya.

0 Likes

#2

See:

https://github.com/crossbario/autobahn-python/issues/336

https://github.com/crossbario/crossbar/issues/429

-Dave

0 Likes