On Mar 16, 2021, at 4:20 AM, Peter Westlake <peter.westlake@pobox.com> wrote:

On Sun, 14 Mar 2021, at 02:08, Glyph wrote:

I did indeed have a half-finished experiment to fix this.  The fix is now finished and in review here: https://twistedmatrix.com/trac/ticket/10125#comment:1 .

If you could review it thoroughly enough, I could land it.

Excellent, thank you!

I think I understand how it works, but one thing puzzles me: how does the queue in the jump() function ever get longer than one element? Is it because it might contain a recursive call, which is activated by the unpause()?

This was actually a really insightful review - after thinking about it for a moment, I realized that the actual trampoline was already in twisted.internet.defer._inlineCallbacks, and this function was totally useless complexity!  Thank you!