Re: [Zope] Zope2 + Twisted

2009-03-06 Thread Lennart Regebro
On Thu, Mar 5, 2009 at 23:51, Peter Sabaini pe...@sabaini.at wrote:
 Hm, the default zope.conf says twisted should be supported as an HTTP server
 replacement -- is that a bug?

If it uses the word supported that is a bug, yes.

In any case, as mentioned, it does not solve your problem. But setting
zserver-threads to 1 does.

-- 
Lennart Regebro: Pythonista, Barista, Notsotrista.
http://regebro.wordpress.com/
+33 661 58 14 64
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope2 + Twisted

2009-03-05 Thread David Bear
could this be satisficed by putting an apache proxy in front of both zope
and twisted?

On Thu, Mar 5, 2009 at 6:17 AM, Peter Sabaini pe...@sabaini.at wrote:

 I'd like to run a Twisted client in Zope 2.10 (for a legacy app).

 How do I do that? Simply loading twisted.internet is probably not a good
 idea
 since Twisted would not work well with ZServer threads, right?

 One thing I tried was enabling Twisted in zope.conf but that gives me the
 following stacktrace (abbr):

  ...
  File /usr/local/zope/2.10/src/Zope-2.10.7-
 final/lib/python/ZConfig/matcher.py, line 188, in constuct
s = st.datatype(s)
  File /usr/local/zope/2.10/src/Zope-2.10.7-
 final/lib/python/Zope2/Startup/datatypes.py, line 349, in __init__
raise ImportError(You do not have twisted installed.)
 ImportError: You do not have twisted installed.


 I've got Twisted on my Pythonpath though.

 TIA,
 peter.


 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )




-- 
David Bear
College of Public Programs at ASU
602-464-0424
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope2 + Twisted

2009-03-05 Thread Peter Sabaini
On Thursday 05 March 2009 18:46:33 you wrote:
 could this be satisficed by putting an apache proxy in front of both zope
 and twisted?

No, not really -- I'd like to use a client written on top of Twisted in a Zope 
product. So, I'd need the twisted reactor and libraries running in the Python 
VM that runs Zope. Which should be no problem except I suspect that I 
shouldn't be using the (threaded) ZServer then, because I think that would 
mess with twisted (which is not threadsafe for the most part). 

I thought if I'd switch to the twisted http server implementation that would 
take care of that -- no threaded ZServer, no problem. Except that doesn't seem 
to work as advertised, since the zope.app.twisted package is not present, and 
the one on PyPI seems to be geared towards Zope3, AFAICT.

Is that so? Is there an alternative zope.app.twisted package for Zope2?

thx,
peter.


 On Thu, Mar 5, 2009 at 6:17 AM, Peter Sabaini pe...@sabaini.at wrote:
  I'd like to run a Twisted client in Zope 2.10 (for a legacy app).
 
  How do I do that? Simply loading twisted.internet is probably not a good
  idea
  since Twisted would not work well with ZServer threads, right?
 
  One thing I tried was enabling Twisted in zope.conf but that gives me the
  following stacktrace (abbr):
 
   ...
   File /usr/local/zope/2.10/src/Zope-2.10.7-
  final/lib/python/ZConfig/matcher.py, line 188, in constuct
 s = st.datatype(s)
   File /usr/local/zope/2.10/src/Zope-2.10.7-
  final/lib/python/Zope2/Startup/datatypes.py, line 349, in __init__
 raise ImportError(You do not have twisted installed.)
  ImportError: You do not have twisted installed.
 
 
  I've got Twisted on my Pythonpath though.
 
  TIA,
  peter.
 
 
  ___
  Zope maillist  -  Zope@zope.org
  http://mail.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope-dev )



signature.asc
Description: This is a digitally signed message part.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope2 + Twisted

2009-03-05 Thread Lennart Regebro
On Thu, Mar 5, 2009 at 18:59, Peter Sabaini pe...@sabaini.at wrote:
 So, I'd need the twisted reactor and libraries running in the Python
 VM that runs Zope. Which should be no problem except I suspect that I
 shouldn't be using the (threaded) ZServer then, because I think that would
 mess with twisted (which is not threadsafe for the most part).

Well, then you could probably set the ZServer to only use one thread.
That means you need many ZServers with a load balancer in front
instead.

 I thought if I'd switch to the twisted http server implementation that would
 take care of that -- no threaded ZServer, no problem. Except that doesn't seem
 to work as advertised, since the zope.app.twisted package is not present, and
 the one on PyPI seems to be geared towards Zope3, AFAICT.

I'm pretty sure the Zope2 implementation doesn't use zope.app.twisted.
However, the Zope 2 implementation is again not thread safe, and will
only work with one thread per server, so you don't actually gain
anything in using it. Besides, I don't think anyone actually used it
after I implemented it. Which is why it's still marked as
experimental, and would probably best be removed again.

-- 
Lennart Regebro: Pythonista, Barista, Notsotrista.
http://regebro.wordpress.com/
+33 661 58 14 64
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope2 + Twisted

2009-03-05 Thread Peter Sabaini
On Thursday 05 March 2009 23:33:40 you wrote:
 On Thu, Mar 5, 2009 at 18:59, Peter Sabaini pe...@sabaini.at wrote:
  So, I'd need the twisted reactor and libraries running in the Python
  VM that runs Zope. Which should be no problem except I suspect that I
  shouldn't be using the (threaded) ZServer then, because I think that
  would mess with twisted (which is not threadsafe for the most part).

 Well, then you could probably set the ZServer to only use one thread.
 That means you need many ZServers with a load balancer in front
 instead.

  I thought if I'd switch to the twisted http server implementation that
  would take care of that -- no threaded ZServer, no problem. Except that
  doesn't seem to work as advertised, since the zope.app.twisted package is
  not present, and the one on PyPI seems to be geared towards Zope3,
  AFAICT.

 I'm pretty sure the Zope2 implementation doesn't use zope.app.twisted.

Zope2/Startup/datatypes.py tries to import it

 However, the Zope 2 implementation is again not thread safe, and will
 only work with one thread per server, so you don't actually gain
 anything in using it. Besides, I don't think anyone actually used it
 after I implemented it. Which is why it's still marked as
 experimental, and would probably best be removed again.

Hm, the default zope.conf says twisted should be supported as an HTTP server 
replacement -- is that a bug?  

Thanks,
peter.




signature.asc
Description: This is a digitally signed message part.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )