[Twisted-web] Twisted Klein idle connection timeout

Tom Most twm at freecog.net
Mon Mar 4 16:25:04 MST 2019


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 <johnaherne at rocs.co.uk> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-web/attachments/20190304/ae6785be/attachment.html>


More information about the Twisted-web mailing list