On Thursday, 11 June 2015 01:33:03 UTC-5, Roger Crew wrote: > > > To my mind the callback runs and as part of its functionality schedules > itself for later execution, it doesn't invoke itself directly as > 'classical' recursion. > > This much is correct, i.e., you're only creating a closure once, and all > calls to it except for the first are coming from the event loop (i.e., each > time the write buffer is emptied, the callback is invoked). However there > is still recursion in the sense that the function is referenced from within > its own body, which means there's a loop of pointers ($cb refers to the sub > and the sub refers to $cb) that the reference-counting garbage collector > will never free up unless you do something to break it > explicitly.(weaken($cb) but do it *after* that first call.) > > > Ah, that's where the recursion is, thanks.
Allan -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
