durusmail: quixote-users: Re: Medusa producers
Medusa producers
2003-08-21
Re: Medusa producers
2003-08-21
2003-08-21
2003-08-21
2003-08-21
2003-08-22
2003-08-22
2003-08-22
2003-08-22
2003-08-22
2003-08-22
response streams [Was: Medusa producers]
response streams
2003-08-27
Re: response streams [Was: Medusa producers]
2003-08-28
Re: Medusa producers
Oleg Broytmann
2003-08-21
On Thu, Aug 21, 2003 at 09:41:34AM -0400, Graham Fawcett wrote:
> Are you suggesting, however, that your *application* should be able to
> return a producer?

   Yes.

> Or something else with an generator-like interface?

   Actually, I am going to wrap a generator (FTP traverse) into a producer.
Something like this:

class iterator_producer:
   def __init__(self, iterator):
      self.iterator = iterator

   def more(self):
      try:
         return str(self.iteration.next())
      except StopIteration:
         return ''

> Personally I like the idea, but would want to make sure that it could
> work correctly with all front ends

   It is already impossible, because all handlers set body to str(output).

> It seems to me that this approach would require Chunked encoding

   Medusa supports it.

Oleg.
--
     Oleg Broytmann            http://phd.pp.ru/            phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

reply