[Twisted-Python] Sending large files over network with perspective broker
Gabriele Lanaro
gabriele.lanaro at gmail.com
Sun May 23 18:36:46 EDT 2010
In which sense it's invalid? I don't know how the gtk reactor works, I just
guessed that the event loop never reaches the gui events. My idea was to
force the processing of these events before spawning another deferred, it's
just a workaround, the real problem is the fact that the server and the
client resides in the same loop (for testing).
Which can be the reason of the mainloop "block"?
2010/5/23 <exarkun at twistedmatrix.com>
> 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
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20100524/65d1bb03/attachment.htm
More information about the Twisted-Python
mailing list