[Twisted-web] twisted.web and sharing class instances with CGI scripts

glyph at divmod.com glyph at divmod.com
Mon Apr 10 19:44:44 CDT 2006

On Mon, 10 Apr 2006 19:35:06 +0200, Fabian Steiner <lists at fabis-site.net> wrote:
>Do you have any idea how to solve this problem? I am looking forward to
>any responses.

CGIs run in subprocesses.  You can't transfer Python objects into subprocesses without making copies.

The best way to solve this problem would be to rewrite your CGI as a twisted.web resource.  You can then pass the wrapper object to the resource and keep it around, making sure that the same resource object is always returned.

More information about the Twisted-web mailing list