Hi. Sorry for stupid question
Can somebody explain me why Mojo::IOLoop::Delay uses
Hash::Util::FieldHash instead of normal attr?
From the doc.
Remaining
"steps"
in chain, stored outside the object to protect from circular
references.
How does that protect from circular references? This confuses
because you may think that refs are weakened and
you can use it as a closure like
my $d = Mojo::IOLoop::Delay->new;
$d->steps( sub { $d->pass; });
But you can't, because it has the same effect as $d->{remaining}
= [sub {$d}].
I thought a lot about why this solution was chosen, I have only one
idea: you can destroy all steps from all delays, but I don't think
that this is the reason because access to the %REMAINING isn't
implemented at all
So maybe I miss a point... or maybe this is a mistake?