Issue #318 resolved

Yields should collapse by default

Robert Brewer
created an issue

Many users like to use "yield" in their page handlers, but aren't prepared for the side-effects of this choice when using HTTP/1.1. Even those developers who need the streaming functionality report that they need it infrequently. Rather than ask people to use "return", we should instead collapse generator-bodies by default. A config entry, "collapseYields" (True by default), should be introduced; setting it to False would enable streamed yields for that path. Therefore, in order to enable streaming yields, you'd have to have HTTP/1.1 on both the client and server sides AND set this value; I don't think that's too much to ask given how uncommon the need is.

My only remaining question is whether this could be sneaked into 2.1 or not...I'd like it to be.

Comments (8)

  1. Anonymous

    i'm one of the 'yield' lovers and i got some content that needs streaming but i'm thinking right now of caching that part. so it might be a good idea to have the feature as default

  2. Anonymous

    I think this makes sense so I think that yes, we should do it (and include it in 2.1-final)

  3. Log in to comment