[Twisted-Python] Sending large files over network with perspective broker

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Sun May 23 10:30:44 MDT 2010


On 12:21 pm, gabriele.lanaro at gmail.com wrote:
>Finally I managed to solve myself this obscure bug. I put the
>reactor.iterate() call before spawning new callbacks, in this way I 
>force
>the mainloop to complete the cycle. The pseudocode would be modified in 
>this
>way:
>
>Client()
>    proceed_sending():
>
>          chunk_tot = CHUNK_TOT
>          chunk_no = 0
>
>          def send(_)
>                if chunk_no == CHUNK_TOT: return
>                else:
>                     ... read data...
>                    reactor.iterate()
><---------------------------------------------------------- THIS LINE
>                    d = filesender.callRemote("send_
>chunk", secret, chunk_no, data)
>                    d.addCallback(send)

Erm.  Sorry.  This isn't a solution to whatever problem you're having. 
It is entirely invalid to use reactor.iterate() in this way.

Jean-Paul




More information about the Twisted-Python mailing list