[Twisted-Python] addWriter

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Oct 29 19:59:51 MST 2002


On Tue, 29 Oct 2002 19:00:27 -0500, "Scherbina, Alexander (ASCHERBI)" <ASCHERBI at arinc.com> wrote:
> I thought, addWriter/doWrite is what I need to use.  When I used them, my
> ConnectionFactory's doWrite was never called after a client connected.
> 
> Is addWriter/doWrite approach correct?  Or am I going in a totally wrong
> direction?  Please, help, if you can.

Depending on your requirements, you should either be doing what spiv suggested
earlier (e.g. "nothing, just call transport.write") or you should be looking
into the producer/consumer API, which will allow you to produce streams of data
on demand.  Last I checked this wasn't terribly well documented, but it's
fairly straightforward and the code in twisted.web.static.FileTransfer is a
decent example.

-- 
 |    <`'>    |  Glyph Lefkowitz: Traveling Sorcerer   |
 |   < _/ >   |  Lead Developer,  the Twisted project  |
 |  < ___/ >  |      http://www.twistedmatrix.com      |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20021029/4fd28707/attachment.sig>


More information about the Twisted-Python mailing list