Re: Twisted Klein idle connection timeout
John Aherne <[email protected]> Wed, 6 Mar 2019 07:57:45 +0000
| Newsgroups | gmane.comp.python.twisted.web |
|---|---|
| Message-ID | <CAKmUHjZ5y7Zwdd1oyjUhfbFkYTUvs8uzucC6xS6jGWtvurM22Q@mail.gmail.com> |
--===============4349947497727147991== Content-Type: multipart/alternative; boundary="000000000000fc72ed05836858ee" --000000000000fc72ed05836858ee Content-Type: text/plain; charset="UTF-8" Thanks for the info. I've taken a look and can't quite see what I need to do. I'll have to take a closer look a bit later and see what I come up with. John On Mon, Mar 4, 2019 at 11:25 PM Tom Most <[email protected]> wrote: > Hi John, > > You can accomplish what you're after by wrapping your Klein instance in > Site yourself --- .run() is just a shortcut that does this (plus initialize > logging). > Call .resource() to get a reource to use as root in the snippet you posted. > > > https://github.com/twisted/klein/blob/86e34a2ea0f26fc7710851912707ab937d0df31d/src/klein/_app.py#L421 > > ---Tom > > > On March 3, 2019 2:30:16 AM PST, John Aherne <[email protected]> > wrote: >> >> Klein defaults to the twisted http timeout of 60 seconds. >> >> But in twisted web Site setup you can define a timeout parameter to >> change this. e.g. >> >> factory = Site(root, timeout=300) >> >> I can't see any option to add a parameter in Klein to change this. >> >> Is there no option for this or have I just missed the obvious setup point. >> >> Thanks for any info. >> >> >> -- >> *John Aherne* >> >> >> >> >> *www.rocs.co.uk <http://www.rocs.co.uk>* >> 020 7223 7567 >> > _______________________________________________ > Twisted-web mailing list > [email protected] > https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web > -- *John Aherne* *www.rocs.co.uk <http://www.rocs.co.uk>* 020 7223 7567 --000000000000fc72ed05836858ee Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Thanks for the info.<div><br></div><div>I've taken a l= ook and can't quite see what I need to do.</div><div><br></div><div>I&#= 39;ll have to take a closer look a bit later and see what I come up with.</= div><div><br></div><div>John</div><div><br></div></div><br><div class=3D"gm= ail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Mar 4, 2019 at 11:= 25 PM Tom Most <<a href=3D"mailto:[email protected]">[email protected]</a>&g= t; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0p= x 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>H= i John,<br> <br> You can accomplish what you're after by wrapping your Klein instance in= Site yourself --- .run() is just a shortcut that does this (plus initializ= e logging).<br> Call .resource() to get a reource to use as root in the snippet you posted.= <br> <br> <a href=3D"https://github.com/twisted/klein/blob/86e34a2ea0f26fc77108519127= 07ab937d0df31d/src/klein/_app.py#L421" target=3D"_blank">https://github.com= /twisted/klein/blob/86e34a2ea0f26fc7710851912707ab937d0df31d/src/klein/_app= .py#L421</a><br> <br> ---Tom<br> <br><br><div class=3D"gmail_quote">On March 3, 2019 2:30:16 AM PST, John Ah= erne <<a href=3D"mailto:[email protected]" target=3D"_blank">johnahe= [email protected]</a>> wrote:<blockquote class=3D"gmail_quote" style=3D"mar= gin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1= ex"> <div dir=3D"ltr"><div dir=3D"ltr">Klein defaults to the twisted http timeou= t of 60 seconds.<div><br></div><div>But in twisted web Site setup you can d= efine a timeout parameter to change this. e.g.</div><div><br></div><div>fac= tory =3D Site(root, timeout=3D300)<br></div><div><br></div><div>I can't= see any option to add a parameter in Klein to change this.</div><div><br><= /div><div>Is there no option for this or have I just missed the obvious set= up point.</div><div><br></div><div>Thanks for any info.</div><div><br></div= ><div><div><br></div>-- <br><div dir=3D"ltr" class=3D"gmail-m_8321729180205= 225020gmail_signature"><b>John Aherne</b><div><b><br></b><div><b><img src= =3D"http://www.rocs.co.uk/Images/rocs_logo_sig.gif"><br></b></div><div><b><= br></b></div><div><div><b><a href=3D"http://www.rocs.co.uk" target=3D"_blan= k">www.rocs.co.uk</a><br></b></div></div></div><div>020 7223 7567</div></di= v></div></div></div> </blockquote></div></div>_______________________________________________<br= > Twisted-web mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">Twisted-= [email protected]</a><br> <a href=3D"https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web" = rel=3D"noreferrer" target=3D"_blank">https://twistedmatrix.com/cgi-bin/mail= man/listinfo/twisted-web</a><br> </blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"= class=3D"gmail_signature"><b>John Aherne</b><div><b><br></b><div><b><img s= rc=3D"http://www.rocs.co.uk/Images/rocs_logo_sig.gif"><br></b></div><div><b= ><br></b></div><div><div><b><a href=3D"http://www.rocs.co.uk" target=3D"_bl= ank">www.rocs.co.uk</a><br></b></div></div></div><div>020 7223 7567</div></= div> --000000000000fc72ed05836858ee-- --===============4349947497727147991== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KVHdpc3RlZC13 ZWIgbWFpbGluZyBsaXN0ClR3aXN0ZWQtd2ViQHR3aXN0ZWRtYXRyaXguY29tCmh0dHBzOi8vdHdp c3RlZG1hdHJpeC5jb20vY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL3R3aXN0ZWQtd2ViCg== --===============4349947497727147991==--