[Twisted-Python] How to improve response time of twisted.web?
Pavel
pbastov at gmail.com
Wed Mar 26 22:53:40 EDT 2008
Yes, I wrote my own resource. Looks like this:
class MyRoot(Resource):
def getChild(self, name, request):
if "" == name:
return self
return Resource
def render_GET(self, request):
path = "/path/to/file"
f = open(path)
content = f.read()
f.close()
return content
On Wed, Mar 26, 2008 at 7:47 PM, Tristan Seligmann
<mithrandi at mithrandi.net> wrote:
> * Pavel <pbastov at gmail.com> [2008-03-26 19:30:41 +0600]:
>
>
> > I added just one resource to my twisted web server that reads a file and
> > returns it to client.
>
> Did you write your own resource to do this, or did you use
> twisted.web.static? If you wrote your own resource, it might be helpful
> if you posted the source code for this as well.
> --
> mithrandi, i Ainil en-Balandor, a faer Ambar
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.8 (GNU/Linux)
>
> iEYEARECAAYFAkfqU/EACgkQpNuXDQIV94oTCQCfd5Se70QCW+/XYvWFOY5UOGr8
> A4QAmwbAVWa2HCyRumq5zJdnF78tFXvi
> =Gd/m
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>
--
Good luck,
Pavel Bastov
xooChat Team Leader
http://www.xoochat.com/
More information about the Twisted-Python
mailing list