![](https://secure.gravatar.com/avatar/aa6c50eb2c42fc20d0615c5c8d0fa587.jpg?s=120&d=mm&r=g)
Hi, I'm new to Twisted an want to understand a little bit more what it can do for me. I have implemented a webchat using the asyncore module. If a user logs in, he will the redirected to a frameset. The top frame contains the 'room view' and is in fact an endless page, so the connection has to be keept alive as long as the user is logged in. The bottom frame contains the input form. It posts a message to the server and the message is written to the open connections of all users in the room. Could somebody explain me, if such an architecture is possible with Twisted, and what might be the benefits compared to using raw asyncore. If possible a very rought roadmap how to begin would also be very helpfull. regards, Achim
![](https://secure.gravatar.com/avatar/b3407ff6ccd34c6e7c7a9fdcfba67a45.jpg?s=120&d=mm&r=g)
On Fri, Jan 31, 2003 at 09:41:15PM +0100, Achim Domma wrote:
It is possible, and the benefits include the fact that it's already written: have a look at the LivePage class in twisted.web.woven.page. ;) But yes, with Twisted Web, you get alot of control over how you respond to requests, including the ability to keep them open and feed new data to them occasionally. -Andrew.
![](https://secure.gravatar.com/avatar/b3407ff6ccd34c6e7c7a9fdcfba67a45.jpg?s=120&d=mm&r=g)
On Sat, Feb 01, 2003 at 11:51:30AM +1100, Andrew Bennetts wrote:
It is possible, and the benefits include the fact that it's already written: have a look at the LivePage class in twisted.web.woven.page. ;)
It's been pointed out to me that LivePage isn't exactly the prettiest code in Twisted, so just think of it as a proof that it can be done, rather than an example of how your code will look :) If you've already got asyncore code written, you probably wouldn't want to use Woven anyway, but just Twisted Web directly... -Andrew.
![](https://secure.gravatar.com/avatar/0b90087ed4aef703541f1cafdb4b49a1.jpg?s=120&d=mm&r=g)
On Fri, Jan 31, 2003 at 09:41:15PM +0100, Achim Domma wrote:
Ldaptor includes functionality to stream LDAP search results one-by-one to a web page, as they are received from the LDAP server. This is pretty much equal to what your "room view" frame does. Twisted.web, no Woven used as this code predates Woven. See ldaptor.apps.webui.search.LDAPSearchEntry.handle_entry(), especially what is does to self.contentDeferred. You can browse the code on the web at http://ldaptor.bkbits.net:8080/ldaptor/anno/lib/ldaptor/apps/webui/search.py@1.20?nav=index.html|src/|src/lib|src/lib/ldaptor|src/lib/ldaptor/apps|src/lib/ldaptor/apps/webui -- :(){ :|:&};:
![](https://secure.gravatar.com/avatar/b3407ff6ccd34c6e7c7a9fdcfba67a45.jpg?s=120&d=mm&r=g)
On Fri, Jan 31, 2003 at 09:41:15PM +0100, Achim Domma wrote:
It is possible, and the benefits include the fact that it's already written: have a look at the LivePage class in twisted.web.woven.page. ;) But yes, with Twisted Web, you get alot of control over how you respond to requests, including the ability to keep them open and feed new data to them occasionally. -Andrew.
![](https://secure.gravatar.com/avatar/b3407ff6ccd34c6e7c7a9fdcfba67a45.jpg?s=120&d=mm&r=g)
On Sat, Feb 01, 2003 at 11:51:30AM +1100, Andrew Bennetts wrote:
It is possible, and the benefits include the fact that it's already written: have a look at the LivePage class in twisted.web.woven.page. ;)
It's been pointed out to me that LivePage isn't exactly the prettiest code in Twisted, so just think of it as a proof that it can be done, rather than an example of how your code will look :) If you've already got asyncore code written, you probably wouldn't want to use Woven anyway, but just Twisted Web directly... -Andrew.
![](https://secure.gravatar.com/avatar/0b90087ed4aef703541f1cafdb4b49a1.jpg?s=120&d=mm&r=g)
On Fri, Jan 31, 2003 at 09:41:15PM +0100, Achim Domma wrote:
Ldaptor includes functionality to stream LDAP search results one-by-one to a web page, as they are received from the LDAP server. This is pretty much equal to what your "room view" frame does. Twisted.web, no Woven used as this code predates Woven. See ldaptor.apps.webui.search.LDAPSearchEntry.handle_entry(), especially what is does to self.contentDeferred. You can browse the code on the web at http://ldaptor.bkbits.net:8080/ldaptor/anno/lib/ldaptor/apps/webui/search.py@1.20?nav=index.html|src/|src/lib|src/lib/ldaptor|src/lib/ldaptor/apps|src/lib/ldaptor/apps/webui -- :(){ :|:&};:
participants (4)
-
Achim Domma
-
Andrew Bennetts
-
Stefano Debenedetti
-
Tommi Virtanen