Python, Twisted , Autobahn Non blocking urllib.urlretrieve code snippet needed

62 views
Skip to first unread message

Sachin Prabhu

unread,
Jun 11, 2014, 9:25:46 AM6/11/14
to autob...@googlegroups.com
I'm looking for a twisted equivalent code snippet for making the urllib.urlretrieve non blocking.

I think i have seen an example of this when i had searched for it sometime back , but i cant seem to find it.

The problem i have with blocking urlretrieve is that it blocks and my client application which uses it , fails to sendPong (heartbeat)

because of which , the server is now blocked and waits for the client to fully download the file before servicing any more requests ,

you can see my concern here , with Huge files being downloaded by the client , the server thinks that the client is inactive or disconnected.

Tobias Oberstein

unread,
Jun 11, 2014, 3:25:55 PM6/11/14
to autob...@googlegroups.com
Am 11.06.2014 15:25, schrieb Sachin Prabhu:
> I'm looking for a twisted equivalent code snippet for making the
> *urllib.urlretrieve *non blocking.

Maybe this helps:

http://twistedmatrix.com/documents/current/web/howto/client.html
http://twistedmatrix.com/documents/current/web/examples/

Sachin Prabhu

unread,
Jun 12, 2014, 2:45:21 AM6/12/14
to autob...@googlegroups.com
Thanks tobias, that was exactly what i was looking for ,

Meanwhile , i was looking how to make my subprocess.popen non blocking ,
here is the code > http://pastebin.com/Yv0HdjTw

Any input would be appreciated.





--
You received this message because you are subscribed to a topic in the Google Groups "Autobahn" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/autobahnws/cR3yyqAZIvU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to autobahnws+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Cheers,
/Sachin Prabhu

Tobias Oberstein

unread,
Jun 12, 2014, 5:53:40 AM6/12/14
to autob...@googlegroups.com
Hi Sachin,

Am 12.06.2014 08:45, schrieb Sachin Prabhu:
> Thanks tobias, that was exactly what i was looking for ,
>
> Meanwhile , i was looking how to make my subprocess.popen non blocking ,
> here is the code > http://pastebin.com/Yv0HdjTw
>
> Any input would be appreciated.

My tip: how about using Google? ;)

http://twistedmatrix.com/documents/current/core/howto/process.html

/Tobias
Reply all
Reply to author
Forward
0 new messages