I am new to AutoBahn/crossbar/twisted and trying to write a RPC progressive call. In the below code, why yield sleep(1) is needed? If I remove that, client is getting all the responses in one chunk instead of progressive. What does yield sleep(1) do for progressive calls?
My understanding was details.progress() takes care of progressive. Can you please explain?
@inlineCallbacks def longop(n, details=None): if details.progress: # caller can (and requested to) consume progressive results for i in range(n): details.progress(i) yield sleep(1) else: # process like a normal call (not producing progressive results) yield sleep(1 * n) returnValue(n) yield self.register(longop, 'com.myapp.longop', RegisterOptions(details_arg='details'))